]> sourceware.org Git - lvm2.git/log
lvm2.git
11 years agofilters: add scm devices
Sebastian Ott [Thu, 10 Jan 2013 19:20:37 +0000 (20:20 +0100)]
filters: add scm devices

Fix this:
pvcreate /dev/scma
  Device /dev/scma not found (or ignored by filtering).

Reported-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
11 years agologging: classify log_debug messages
Alasdair G Kergon [Mon, 7 Jan 2013 22:30:29 +0000 (22:30 +0000)]
logging: classify log_debug messages

Place most log_debug() messages into a class.

11 years agologging: add debug classes
Alasdair G Kergon [Mon, 7 Jan 2013 22:25:19 +0000 (22:25 +0000)]
logging: add debug classes

Add log/debug_classes to lvm.conf to allow debug messages to be
classified and filtered at runtime.

The dm_errno field is only used by log_error(), so I've redefined it
for log_debug() messages to hold the message class.

By default, all existing messages appear, but we can add categories that
generate high volumes of data, such as logging all traffic to/from
lvmetad.

11 years agolvmetad: fix format1 updates
Alasdair G Kergon [Sat, 5 Jan 2013 03:07:43 +0000 (03:07 +0000)]
lvmetad: fix format1 updates

fmt1 doesn't have a separate commit function: updates take effect
immediately vg_write is called, so we must update lvmetad at this
point if we're going to go on and ask lvmetad for the VG metadata
again before calling the commit function (though that's probably an
unsupported and pointless thing to do anyway as the client must
already have that data and it cannot have changed because it's locked
and with devs suspended we shouldn't be communicating with lvmetad;
so when that's fixed properly, this fix here can be reverted).

This problem showed up as an internal error when lvremoving an LVM1
snapshot.

> Internal error: LV snap1 (00000000000000000000000000000001) missing from preload metadata

https://bugzilla.redhat.com/891855

11 years agolvmetad: add basic client-side debug logging
Alasdair G Kergon [Sat, 5 Jan 2013 00:35:50 +0000 (00:35 +0000)]
lvmetad: add basic client-side debug logging

First attempt at showing precisely what use any command is making of
lvmetad in the -vvvv trace information.

11 years agolvmetad: rename device vars and move _token_update
Alasdair G Kergon [Fri, 4 Jan 2013 23:45:22 +0000 (23:45 +0000)]
lvmetad: rename device vars and move _token_update

Move _token_update() to avoid the need for _lvmetad_send prototype.

Use 'dev' consistently for a struct device * variable.
Use 'devno' for a dev_t.

11 years agolibdaemon: add logging to daemon_open
Alasdair G Kergon [Fri, 4 Jan 2013 23:29:59 +0000 (23:29 +0000)]
libdaemon: add logging to daemon_open

Log all conditions encountered in daemon_open().

Only store errno when known to be set.

11 years agolvmetad: improve client logging when connecting
Alasdair G Kergon [Fri, 4 Jan 2013 23:22:30 +0000 (23:22 +0000)]
lvmetad: improve client logging when connecting

Rename lvmetad_warning() to lvmetad_connect_or_warn().

Log all connection attempts on the client side, whether successful or not.

Reduce some nesting and remove a redundant assertion.

11 years agolvmetad: lvm depends on libdaemonclient.a
Alasdair G Kergon [Fri, 4 Jan 2013 23:10:38 +0000 (23:10 +0000)]
lvmetad: lvm depends on libdaemonclient.a

Rebuild lvm binary if libdaemonclient.a changes.

11 years agopvscan: synchronize with udev if pvscan --cache is used.
Peter Rajnoha [Fri, 21 Dec 2012 09:54:31 +0000 (10:54 +0100)]
pvscan: synchronize with udev if pvscan --cache is used.

We need to call sync_local_dev_names directly as pvscan uses
VG_GLOBAL lock and this one *does not* cause the synchronization
(sync_dev_names) to be called on unlock (VG_GLOBAL is not a real VG):

define unlock_vg(cmd, vol)
  do { \
    if (is_real_vg(vol)) \
      sync_dev_names(cmd); \
    (void) lock_vol(cmd, vol, LCK_VG_UNLOCK); \
  } while (0)

Without this fix, we end up without udev synchronization for the
pvscan --cache (mainly for -aay that causes the VGs/LVs to be
autoactivated) and also udev synchronization cookies are then left
in the system since they're not managed properly (code before sets
up udev sync cookies, but we have to call dm_udev_wait at least once
after that to do the wait and cleanup).

11 years agoactivation: fix autoactivation to not trigger on each PV change
Peter Rajnoha [Fri, 21 Dec 2012 09:34:48 +0000 (10:34 +0100)]
activation: fix autoactivation to not trigger on each PV change

Before, the pvscan --cache -aay was called on each ADD and CHANGE
uevent (for a device that is not a device-mapper device) and each CHANGE
event (for a PV that is a device-mapper device).

This causes troubles with autoactivation in some cases as CHANGE event
may originate from using the OPTION+="watch" udev rule that is defined
in 60-persistent-storage.rules (part of the rules provided by udev
directly) and it's used for all block devices
(except fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md* devices). For example, the
following sequence incorrectly activates the rest of LVs in a VG if one
of the LVs in the VG is being removed:

[root@rhel6-a ~]# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created

[root@rhel6-a ~]# vgcreate vg /dev/sda
  Volume group "vg" successfully created

[root@rhel6-a ~]# lvcreate -l1 vg
  Logical volume "lvol0" created

[root@rhel6-a ~]# lvcreate -l1 vg
  Logical volume "lvol1" created

[root@rhel6-a ~]# vgchange -an vg
  0 logical volume(s) in volume group "vg" now active

[root@rhel6-a ~]# lvs
  LV      VG        Attr      LSize   Pool Origin Data%  Move Log
Cpy%Sync Convert
  lvol0   vg        -wi------   4.00m
  lvol1   vg        -wi------   4.00m

[root@rhel6-a ~]# lvremove -ff vg/lvol1
  Logical volume "lvol1" successfully removed

[root@rhel6-a ~]# lvs
  LV      VG        Attr      LSize   Pool Origin Data%  Move Log
Cpy%Sync Convert
  lvol0   vg        -wi-a----   4.00m

...so the vg was deactivated, then lvol1 removed, and we end up with
lvol1 removed (which is ok) BUT with lvol0 activated (which is wrong)!!!
This is because after lvol1 removal, we need to write metadata to the
underlying device /dev/sda and that causes the CHANGE event to be
generated (because of the WATCH udev rule set on this device) and this
causes the pvscan --cache -aay to be reevaluated.

We have to limit this and call pvscan --cache -aay to autoactivate
VGs/LVs only in these cases:

 --> if the *PV is not a dm device*, scan only after proper device
addition (ADD event) and not with any other changes (CHANGE event)

 --> if the *PV is a dm device*, scan only after proper mapping
activation (CHANGE event + the underlying PV in a state "just
activated")

11 years agoRAID: Limit replacement of devices when array is not in-sync.
Jonathan Brassow [Tue, 18 Dec 2012 20:40:42 +0000 (14:40 -0600)]
RAID:  Limit replacement of devices when array is not in-sync.

If a RAID array is not in-sync, replacing devices should not be allowed
as a general rule.  This is because the contents used to populate the
incoming device may be undefined because the devices being read where
not in-sync.  The kernel enforces this rule unless overridden by not
allowing the creation of an array that is not in-sync and includes a
devices that needs to be rebuilt.

Since we cannot know the sync state of an LV if it is inactive, we must
also enforce the rule that an array must be active to replace devices.

That leaves us with the following conditions:
1) never allow replacement or repair of devices if the LV is in-active
2) never allow replacement if the LV is not in-sync
3) allow repair if the LV is not in-sync, but warn that contents may
   not be recoverable.

In the case where a user is performing the repair on the command line via
'lvconvert --repair', the warning is printed before the user is prompted
if they would like to replace the device(s).  If the repair is automated
(i.e. via dmeventd and policy is "allocate"), then the device is replaced
if possible and the warning is printed.

11 years agoWHATS_NEW: changelog for fae1a611d2 and 5294a6f77a
Peter Rajnoha [Tue, 18 Dec 2012 11:12:58 +0000 (12:12 +0100)]
WHATS_NEW: changelog for fae1a611d2 and 5294a6f77a

11 years agolvm2app: No special behavior for 0 for max_snap_size in lvm_lv_snapshot()
Andy Grover [Mon, 17 Dec 2012 22:14:38 +0000 (14:14 -0800)]
lvm2app: No special behavior for 0 for max_snap_size in lvm_lv_snapshot()

It isn't possible to choose a sane default for snapshot size, so just
play it straight and use the passed size instead of adding special
behavior for 0.

Also revert change to Python lib, size parameter must be supplied.

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agoRevert "lvmetad: simplify pvid memory allocation."
Zdenek Kabelac [Mon, 17 Dec 2012 12:49:19 +0000 (13:49 +0100)]
Revert "lvmetad: simplify pvid memory allocation."

This reverts commit ed23da95b63308e11f8d680b189686a5d2d380d0.

Hash table device_to_pvid  seems to contain references to
already deleted pvids and so revert to the older
behaviour using allocated memory.

11 years agolvmetad: Fix a possible race in remove_metadata.
Petr Rockai [Sun, 16 Dec 2012 23:43:18 +0000 (00:43 +0100)]
lvmetad: Fix a possible race in remove_metadata.

All operations on shared hash tables need to be protected by mutexes. Moreover,
lookup and subsequent key removal need to happen atomically, to avoid races (and
possible double free-ing) between multiple threads trying to manipulate the same
VG.

11 years agolvmetad: Fix a possible deadlock.
Petr Rockai [Sun, 16 Dec 2012 23:39:00 +0000 (00:39 +0100)]
lvmetad: Fix a possible deadlock.

If an update and a query were running in parallel, there was a slim but non-zero
chance of a deadlock due to (unnecessary) mutex nesting.

11 years agolvmetad: simplify pvid memory allocation.
Zdenek Kabelac [Sat, 15 Dec 2012 16:00:35 +0000 (17:00 +0100)]
lvmetad: simplify pvid memory allocation.

Since pvid_dup and cft config appears to be tightly
binded together - reuse it's memory pool for string.
Simplifies release of hashes.

11 years agothin: dmeventd fix memleak on error path
Zdenek Kabelac [Thu, 13 Dec 2012 19:19:38 +0000 (20:19 +0100)]
thin: dmeventd fix memleak on error path

Some error paths on _umount have leaked bitset.

11 years agopv_read: add missing check for valid info
Zdenek Kabelac [Fri, 14 Dec 2012 13:06:33 +0000 (14:06 +0100)]
pv_read: add missing check for valid info

If the lvmcache_info_from_pvid() fails to find valid
info, invoke the lookup by dev, and only in this case
call lvmcache_info_from_pvid() again.

Also check for the result of info and return
error directly, so the NULL is not passed
to lvmcache_get_label().

11 years agolvmetad: add check for failure dm_config_write_node
Zdenek Kabelac [Fri, 14 Dec 2012 20:36:27 +0000 (21:36 +0100)]
lvmetad: add check for failure dm_config_write_node

Detect if dm_config_write_node failed and fail correctly.

11 years agolvmetad: fix socket leak in handle_connect
Zdenek Kabelac [Fri, 14 Dec 2012 20:31:22 +0000 (21:31 +0100)]
lvmetad: fix socket leak in handle_connect

Close socket_fd and report error on malloc failure.

11 years agolvmetad: check id_read_format error status
Zdenek Kabelac [Fri, 14 Dec 2012 15:45:15 +0000 (16:45 +0100)]
lvmetad: check id_read_format error status

Detect error from id_read_format() function.

11 years agolvmetad: fix memleak on pv_found error path
Zdenek Kabelac [Fri, 14 Dec 2012 15:43:42 +0000 (16:43 +0100)]
lvmetad: fix memleak on pv_found error path

Free resources allocated in pv_found when going out
through error path.

11 years agolvmetad: keep returned struct fully initialized
Zdenek Kabelac [Fri, 14 Dec 2012 15:38:07 +0000 (16:38 +0100)]
lvmetad: keep returned struct fully initialized

Always clear the response structure.
Simplify daemon_reply initialization.

11 years agolvmetad: unlock vg on out-of-memory path
Zdenek Kabelac [Fri, 14 Dec 2012 15:35:26 +0000 (16:35 +0100)]
lvmetad: unlock vg on out-of-memory path

If we fail to get memory for mutex, hash the mutex
or fail somewhere along pthread function calls
return allocated resources back and unlock vg_lock_map mutex.

11 years agolibdaemon: check for strdup result
Zdenek Kabelac [Fri, 14 Dec 2012 00:00:36 +0000 (01:00 +0100)]
libdaemon: check for strdup result

Detect failure of dm_pool_strdup() and print error in fail path.
Save one extra strchr call - since we already know the distance
for the '=' character.

Drop stack trace from return after log_error().

11 years agoformat-text: check for _text_create_text_instance
Zdenek Kabelac [Fri, 14 Dec 2012 20:34:28 +0000 (21:34 +0100)]
format-text: check for _text_create_text_instance

Test if 'fid' creation failed and report stack trace,
break the loop and do not pass NULL fid further.

11 years agolog: move abort past syslog
Zdenek Kabelac [Fri, 14 Dec 2012 12:57:01 +0000 (13:57 +0100)]
log: move abort past syslog

When the abort_on_internal_errors is enabled, we aborted prior
the syslog logging output.

Since such fatal error gets level _LOG_FATAL it should
not be blocked by debug_level() check so lets move it further,
to get abort error logged also via syslog.

11 years agocleanup: use proper const in apply_lvname_restrictions
Zdenek Kabelac [Fri, 14 Dec 2012 13:03:58 +0000 (14:03 +0100)]
cleanup: use proper const in apply_lvname_restrictions

Better constness used for reserved prefixes and strings.
Also simplify a bit validate_name and use direct char
checks isntead of 2 strcmp() calls.

11 years agocleanup: reorder code
Zdenek Kabelac [Fri, 14 Dec 2012 18:43:42 +0000 (19:43 +0100)]
cleanup: reorder code

Swap if() test condition and check for failure
and use traditional 'stack' trace.

11 years agocleanup: skip assignment
Zdenek Kabelac [Fri, 14 Dec 2012 13:18:46 +0000 (14:18 +0100)]
cleanup: skip assignment

env is reassigned without the use, so drop this assign.

11 years agocleanup: simplify option matching function
Zdenek Kabelac [Fri, 14 Dec 2012 15:41:24 +0000 (16:41 +0100)]
cleanup: simplify option matching function

Avoid using sprintf and strncmp call, when
we really want to compare just one character.

11 years agocleanup: singlenode minor change
Zdenek Kabelac [Fri, 14 Dec 2012 13:01:19 +0000 (14:01 +0100)]
cleanup: singlenode minor change

Use strcpy instead of sprintf for plain string.
And use dm_strncpy for safer strncpy.

TODO: Fix API return values for cluster functions.

11 years agocleanup: ignore return values
Zdenek Kabelac [Fri, 14 Dec 2012 17:58:18 +0000 (18:58 +0100)]
cleanup: ignore return values

These dm_snprintfs should not fail, since enough space is reserved.
So return intentionaly ignored.

11 years agocleanup: ignore errors
Zdenek Kabelac [Thu, 13 Dec 2012 18:55:33 +0000 (19:55 +0100)]
cleanup: ignore errors

Since we are doing just dump and function doesn't report
any error, explicitely ignore return values from
dm_config_write_node and dm_asprintf.

Same applies for the logging function.

11 years agocleanup: drop unused header
Zdenek Kabelac [Thu, 13 Dec 2012 19:35:00 +0000 (20:35 +0100)]
cleanup: drop unused header

This header does not resolve any symbols here.

11 years agocleanup: drop test for optarg NULL
Zdenek Kabelac [Thu, 13 Dec 2012 18:54:07 +0000 (19:54 +0100)]
cleanup: drop test for optarg NULL

Since -d takes an argument, we do not need to check for
optarg being NULL here.

11 years agocleanup: convert to 32bit
Zdenek Kabelac [Thu, 13 Dec 2012 19:35:38 +0000 (20:35 +0100)]
cleanup: convert to 32bit

Chunk sizes fits into 4G range, so keep it in 32bit range.

11 years agopython-lvm: Make second lv.snapshot() argument optional
Andy Grover [Fri, 14 Dec 2012 22:10:41 +0000 (14:10 -0800)]
python-lvm: Make second lv.snapshot() argument optional

If no size is given, size defaults to 0, which in lvm_lv_snapshot will
allocate extents equal to the original LV be allocated for the new
snapshot.

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopython-lvm: whitespace in python/liblvm.c.
Andy Grover [Fri, 14 Dec 2012 18:32:35 +0000 (10:32 -0800)]
python-lvm: whitespace in python/liblvm.c.

Sorry, it bugged me. Should be perfect now.

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopython-lvm: Small fixups to new create_lv_snapshot
Andy Grover [Fri, 14 Dec 2012 18:17:29 +0000 (10:17 -0800)]
python-lvm: Small fixups to new create_lv_snapshot

Tabify

Remove use of asize, unneeded.

Don't initialize lvobj->parent_vgobj to NULL, the object ctor already
zeroed everything on alloc.

Redo call to lvm_lv_snapshot to use the liblvm snapshot implementation
we went with.

Add {}s to silence warning in lv_dealloc.

Rename snapshot function for consistency.

Update WHATS_NEW.

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopython-lvm: Add snapshot support
James Antill [Fri, 14 Dec 2012 01:39:09 +0000 (17:39 -0800)]
python-lvm: Add snapshot support

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agolvm2app: Add lv snapshot support
Tony Asleson [Fri, 14 Dec 2012 01:57:38 +0000 (17:57 -0800)]
lvm2app: Add lv snapshot support

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agolvconvert: also allow --type with --stripes
Peter Rajnoha [Thu, 13 Dec 2012 10:15:37 +0000 (11:15 +0100)]
lvconvert: also allow --type with --stripes

We can also use this for conversion between different mirror segment
types. Each new segment type converter then needs to check itself
whether the --stripes is applicable.

11 years agoUpdate WHATS_NEW.
Petr Rockai [Wed, 12 Dec 2012 14:17:08 +0000 (15:17 +0100)]
Update WHATS_NEW.

11 years agotoollib: Avoid a global lock in process_each_pv if lvmetad is used.
Petr Rockai [Wed, 12 Dec 2012 13:39:52 +0000 (14:39 +0100)]
toollib: Avoid a global lock in process_each_pv if lvmetad is used.

The motivation to grab the global lock is to avoid a scan and metadata parsing
for each PV, but the cost of obtaining metadata is _mostly_ mitigated by having
lvmetad around. Not taking the global lock improves throughput when multiple pvs
or related commands are running in parallel, like in RHEV.

11 years agolvmetad: fix compiler warning and add WHATS_NEW line for previous commit
Peter Rajnoha [Wed, 12 Dec 2012 12:27:25 +0000 (13:27 +0100)]
lvmetad: fix compiler warning and add WHATS_NEW line for previous commit

11 years agolvmetad: Fix autoactivation for MDA-less PVs.
Petr Rockai [Wed, 12 Dec 2012 11:51:28 +0000 (12:51 +0100)]
lvmetad: Fix autoactivation for MDA-less PVs.

Calling pvscan --cache with -aay on a PV without an MDA would spuriously fail
with an internal error, because of an incorrect assumption that a parsed VG
structure was always available. This is not true and the autoactivation handler
needs to call vg_read to obtain metadata in cases where the PV had no MDAs to
parse. Therefore, we pass vgid into the handler instead of the (possibly NULL)
VG coming from the PV's MDA.

11 years agolvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool
Peter Rajnoha [Tue, 11 Dec 2012 14:50:25 +0000 (15:50 +0100)]
lvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool

Also, update lvconvert man page to reflect this and make clear that
the --stripes/stripesize is applied to newly allocated space only.

11 years agotest: update thin discards testing
Zdenek Kabelac [Mon, 10 Dec 2012 09:51:25 +0000 (10:51 +0100)]
test: update thin discards testing

Reflect fixed disards behavior.

11 years agolvmetad: use dm_config_destroy to free pvmeta
Marian Csontos [Mon, 10 Dec 2012 13:24:55 +0000 (14:24 +0100)]
lvmetad: use dm_config_destroy to free pvmeta

Release pvmeta handler with proper dm_config_destroy() function.
TODO: Fix primary fault for this internal error.

Signed-off-by: mcsontos@redhat.com
11 years agothin: fix test for dicards ignore settings
Zdenek Kabelac [Mon, 10 Dec 2012 09:22:48 +0000 (10:22 +0100)]
thin: fix test for dicards ignore settings

Arghh, this was bad last-minute shortening of if() expression
in the commit 1ef98310187a7.

dm_tree_node_set_thin_pool_discard() must not run in the same
expression as check for non-power-2 discard, otherwise
there are 2 calls for dm_tree_node_set_thin_pool_discard
and whole setting of discards is missinterpretted.

In-relase fix it by using proper parentheses {}.

11 years agothin: remove detection for thin discard support
Zdenek Kabelac [Mon, 10 Dec 2012 09:22:16 +0000 (10:22 +0100)]
thin: remove detection for thin discard support

Remove no longer needed warning for unsuppoted discards
for non-power-2 lvcreate commands.

(Missed from the patch for the same update in lvchange made
by commit dde5a6c52b315d7b)

11 years agomirrors: fix leak in device_is_usable mirror check
Zdenek Kabelac [Thu, 6 Dec 2012 22:37:21 +0000 (23:37 +0100)]
mirrors: fix leak in device_is_usable mirror check

Function _ignore_blocked_mirror_devices was not release
allocated strings images_health and log_health.

In error paths it was also not releasing dm_task structure.

Swaped return code of _ignore_blocked_mirror_devices and
use 1 as success.

In _parse_mirror_status use log_error if memory allocation
fails and few more errors so they are no going unnoticed
as debug messages.

On error path always clear return values and free strings.

For dev_create_file  use cache mem pool to avoid memleak.

11 years agolvconvert: do not ignore -f in lvconvert --repair -y -f
Peter Rajnoha [Tue, 11 Dec 2012 08:52:54 +0000 (09:52 +0100)]
lvconvert: do not ignore -f in lvconvert --repair -y -f

11 years agoFix Py_BuildValue for i386
James Antill [Thu, 6 Dec 2012 00:31:30 +0000 (16:31 -0800)]
Fix Py_BuildValue for i386

see https://bugzilla.redhat.com/show_bug.cgi?id=881989

Signed-off-by: James Antill <james.antill@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopvmove/RAID: Disallow pvmove on RAID LVs until properly handled
Jonathan Brassow [Tue, 4 Dec 2012 23:47:47 +0000 (17:47 -0600)]
pvmove/RAID:  Disallow pvmove on RAID LVs until properly handled

Attempting pvmove on RAID LVs replaces the kernel RAID target with
a temporary pvmove target, ultimately destroying the RAID LV.  pvmove
must be prevented on RAID LVs for now.

Use 'lvconvert --replace old_pv vg/lv new_pv' if you want to move
an image of the RAID LV.

11 years agoactivation: don't miss the log on empty {auto_activation|read_only|}_volume_list
Peter Rajnoha [Tue, 4 Dec 2012 13:10:03 +0000 (14:10 +0100)]
activation: don't miss the log on empty {auto_activation|read_only|}_volume_list

Addendum to previous commit...

11 years agoAllow empty activation/{auto_activation|read_only|}_volume_list config option.
Peter Rajnoha [Tue, 4 Dec 2012 09:33:54 +0000 (10:33 +0100)]
Allow empty activation/{auto_activation|read_only|}_volume_list config option.

In case we don't want to activate, autoactivate or have the
VG/LV read-only. Primarily targeted for the auto_activation_volume_list,
but it makes no harm for other settings (the part of the code
that reads these three settings is shared, but there's no
reason to separate it only for this change).

11 years agothin: update thin feature detection
Zdenek Kabelac [Mon, 3 Dec 2012 12:03:41 +0000 (13:03 +0100)]
thin: update thin feature detection

Safe 1 static var and keep whole detection within one function.

11 years agothin: reworked thin feature detection
Zdenek Kabelac [Mon, 3 Dec 2012 10:52:04 +0000 (11:52 +0100)]
thin: reworked thin feature detection

Rework thin feature detection to support runtime
section to allow to disable them selectively.

New lvm.conf option is born: global/thin_disabled_features

11 years agothin: lvconvert supports swapping metadata device
Zdenek Kabelac [Sun, 2 Dec 2012 15:40:07 +0000 (16:40 +0100)]
thin: lvconvert supports swapping metadata device

Support swapping of metadata device if the thin pool already
exists. This way it's easy to i.e. resize metadata or their
repair operation.

User may create some empty LV, replace existing metadata
or dump and restore them into bigger LV.

11 years agolibdm: deactivate failed node in preload
Zdenek Kabelac [Sun, 2 Dec 2012 15:32:42 +0000 (16:32 +0100)]
libdm: deactivate failed node in preload

If the resume of preloaded node fails, do not leave such
node in the table - since it may not be easy to detach such
node later when the node is i.e. internal.

i.e. failing activation of the thin pool with mismatching
chunk size may leave -tpool device in the table, which
could have been then removed only by dmsetup command.

11 years agothin: deactivate subvolumes
Zdenek Kabelac [Sun, 2 Dec 2012 15:31:27 +0000 (16:31 +0100)]
thin: deactivate subvolumes

Do not leave active thin data and metadata volumes
if activation of thin pool fails.

11 years agothin: lvchange may change discards freely
Zdenek Kabelac [Sun, 2 Dec 2012 15:30:45 +0000 (16:30 +0100)]
thin: lvchange may change discards freely

11 years agothin: shuffle code
Zdenek Kabelac [Sun, 2 Dec 2012 15:27:39 +0000 (16:27 +0100)]
thin: shuffle code

Reorder code lines for next patch.

11 years agothin: lvconvert update messages
Zdenek Kabelac [Sun, 2 Dec 2012 15:23:44 +0000 (16:23 +0100)]
thin: lvconvert update messages

11 years agothin: add detach_pool_metadata_lv
Zdenek Kabelac [Sun, 2 Dec 2012 00:28:51 +0000 (01:28 +0100)]
thin: add detach_pool_metadata_lv

Add internal function detach_pool_metadata_lv().

11 years agotests: add error_dev aux
Zdenek Kabelac [Sat, 1 Dec 2012 16:09:18 +0000 (17:09 +0100)]
tests: add error_dev aux

Aux function to replace PV with specifically damaged device.
Usage:

   aux error_dev "$dev1" 8:32 96:8

Replaces from 8 sector 32 error 512b sectors
and from 96 sector next 8 sectors will fail on rw.
Rest of device is preserved.

For testing:
dd if="$dev1" of=x bs=512 count=104 conv=sync,noerror iflag=direct

11 years agotests: resume devices on background
Zdenek Kabelac [Thu, 29 Nov 2012 16:39:36 +0000 (17:39 +0100)]
tests: resume devices on background

Since some devices may need correct order of their resuming,
resume then all on background and wait for finish.

11 years agolvm2api: fix size reporting
Zdenek Kabelac [Thu, 29 Nov 2012 09:29:03 +0000 (10:29 +0100)]
lvm2api: fix size reporting

API is reporting all sizes as 64bit integers in bytes.
Fix at those places, where sectors were returned
to remain consistent.

11 years agoman page (lvcreate): Better explain stripes option for RAID 4/5/6.
Jonathan Brassow [Fri, 30 Nov 2012 22:47:02 +0000 (16:47 -0600)]
man page (lvcreate):  Better explain stripes option for RAID 4/5/6.

Do a better job explaining the '--stripes/-i' option to lvcreate
when it comes to RAID 4/5/6.  The extra devices needed for parity
are implicitly added to the argument given.  So a 5-device RAID6
logical volume is created with '-i 3' - indicating 3 stripes plus
the implicit 2 devices needed for RAID6.

11 years agoudev: add a warning message if DM_DISABLE_UDEV set and udev running
Peter Rajnoha [Thu, 29 Nov 2012 14:50:52 +0000 (15:50 +0100)]
udev: add a warning message if DM_DISABLE_UDEV set and udev running

$ export DM_DISABLE_UDEV=1

$ dmsetup create test --table "0 1 zero"
Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory.

$ lvchange -ay vg/lvol0
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will manage logical volume symlinks in device directory.
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will obtain device list by scanning device directory.
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory.

11 years agoudev: _udev_disabled var visible also for !UDEV_SYNC_SUPPORT
Peter Rajnoha [Thu, 29 Nov 2012 13:40:12 +0000 (14:40 +0100)]
udev: _udev_disabled var visible also for !UDEV_SYNC_SUPPORT

11 years agoudev: recognize DM_DISABLE_UDEV environment variable
Peter Rajnoha [Thu, 29 Nov 2012 13:03:48 +0000 (14:03 +0100)]
udev: recognize DM_DISABLE_UDEV environment variable

Setting this environment variable will cause a full fallback
to old direct node and symlink management in libdevmapper and lvm2.

It means:

 - disabling udev synchronization
   (--noudevsync in dmsetup and --noudevsync + activation/udev_sync=0
    lvm2 config)
 - disabling dm and any subsystem related udev rules
   (--noudevrules in dmsetup and activation/udev_rules=0 lvm2 config)
 - management of nodes/symlinks under /dev directly by libdevmapper/lvm2
   (--verifyudev in dmsetup and activation/verify_udev_operations=1
    lvm2 config)
 - not obtaining any device list from udev database
   (devices/obtain_device_list_from_udev=0 lvm2 config)

Note: we could set all of these before - there's no functional change!
However the DM_DISABLE_UDEV environment variable is a nice shortcut
to make it easier for libdevmapper users so that one can switch off all
of the udev management off at one go directly on the command line,
without a need to modify any source or add any extra switches.

11 years agoudev: do not verify udev operations for --noudevsync
Peter Rajnoha [Thu, 29 Nov 2012 12:59:12 +0000 (13:59 +0100)]
udev: do not verify udev operations for --noudevsync

If udev synchronization is disabled by means of --noudevsync
option, we should disable just the synchronization and nothing else.
The udev fallback (verifying udev operations and fixing the
nodes/symlinks if found incorrect) is orthogonal and controlled
by a separate activation/verify_udev_operations configuration option.

11 years agotests: update thin testing
Zdenek Kabelac [Tue, 27 Nov 2012 00:01:38 +0000 (01:01 +0100)]
tests: update thin testing

11 years agothin: fix property discard for lvm2api
Zdenek Kabelac [Tue, 27 Nov 2012 10:02:49 +0000 (11:02 +0100)]
thin: fix property discard for lvm2api

Discards property is string and may have these values:
  ignore, nopassdown, passdown

11 years agothin: allow restore with --force
Zdenek Kabelac [Mon, 26 Nov 2012 22:45:35 +0000 (23:45 +0100)]
thin: allow restore with --force

Allow restoring metadata with thin pool volumes.
No validation is done for this case within vgcfgrestore tool -
thus incorrect metadata may lead to destruction of pool content.

11 years agothin: fix attrs for unloaded driver
Zdenek Kabelac [Mon, 26 Nov 2012 10:05:30 +0000 (11:05 +0100)]
thin: fix attrs for unloaded driver

If the driver is not loaded, set all 'features' ON
instead of all of them being OFF.

11 years agofilters: Add STEC skd and Violin vtms devices
Alasdair G Kergon [Mon, 26 Nov 2012 14:55:17 +0000 (14:55 +0000)]
filters: Add STEC skd and Violin vtms devices

11 years agothin: support configurable thin pool defaults
Zdenek Kabelac [Mon, 26 Nov 2012 10:20:13 +0000 (11:20 +0100)]
thin: support configurable thin pool defaults

Configurable settings for thin pool create
if they are not specified on command line.

New supported lvm.conf options are:
  allocation/thin_pool_chunk_size
  allocation/thin_pool_discards
  allocation/thin_pool_zero

11 years agothin: add more unsupporte options for merge
Zdenek Kabelac [Mon, 26 Nov 2012 10:14:36 +0000 (11:14 +0100)]
thin: add more unsupporte options for merge

Hmm, we need some smarter way to detect unsupported command
line options for various commands.

11 years agothin: detect discards for non-power-2
Zdenek Kabelac [Mon, 26 Nov 2012 10:04:00 +0000 (11:04 +0100)]
thin: detect discards for non-power-2

Check if target supports discards for chunk sizes,
that are not power of 2 (just multiple of 64K),
and enable it in case it's supported by thin kernel target.

11 years agolvm2api: fix typo
Zdenek Kabelac [Wed, 21 Nov 2012 13:29:52 +0000 (14:29 +0100)]
lvm2api: fix typo

oops, typo didn't cause compile error

11 years agoAutomatically restore MISSING PVs with no MDAs.
Petr Rockai [Sun, 25 Nov 2012 19:41:56 +0000 (20:41 +0100)]
Automatically restore MISSING PVs with no MDAs.

11 years agoRAID: If no stripes argument is given for RAID10 create, default to 2
Jonathan Brassow [Thu, 22 Nov 2012 00:46:52 +0000 (18:46 -0600)]
RAID:  If no stripes argument is given for RAID10 create, default to 2

Similar to the way the 'mirror', 'raid1' and 'raid10' segment types set
the number of mirrors to 2 ('-m 1') if the argument is not specified,
here we set the number of stripes to 2 if not given on the command line
when creating a RAID10 LV.

11 years agoRAID: Do not allow --splitmirrors on RAID10 logical volumes.
Jonathan Brassow [Thu, 22 Nov 2012 00:39:26 +0000 (18:39 -0600)]
RAID:  Do not allow --splitmirrors on RAID10 logical volumes.

RAID10 does not have the ability to split off images for independent
use.  So, 'lvconvert --splitmirrors' will not work and must be
disallowed.

11 years agolv_manip: fix regresion from bf2741376d4
Zdenek Kabelac [Wed, 21 Nov 2012 08:46:18 +0000 (09:46 +0100)]
lv_manip: fix regresion from bf2741376d4

Commit bf2741376d47411994d4065863acab8e405ff5c7 started to use
lv_is_active() instead of call for lv_info & info.exists so
we cover also cluster activated devices.
For snapshost the conversion was not correct and introduced
regression by blocking creation of snapshot of inactive LV.

Fix it by assigning lv_is_active() directly.
Note: we still have minor issue to fix - to make
lv_is_???? function able to return error states since
lv_info() may fail.

11 years agomm: skip mlocking [vectors]
Zdenek Kabelac [Tue, 20 Nov 2012 08:58:53 +0000 (09:58 +0100)]
mm: skip mlocking [vectors]

Somehow forgotten:
https://www.redhat.com/archives/linux-lvm/2012-June/msg00019.html
Need for arm architecture support.

11 years agodocs: host tags has a default volume_list
Alasdair G Kergon [Mon, 19 Nov 2012 22:29:23 +0000 (22:29 +0000)]
docs: host tags has a default volume_list

Document that lvm.conf activation/volume_list defaults to @* when
there's a host tag.

11 years agothin: update recent patchset
Zdenek Kabelac [Mon, 19 Nov 2012 15:23:18 +0000 (16:23 +0100)]
thin: update recent patchset

Parse pool params only for creation of thin pools.

11 years agoDocument use_lvmetad and global_filter in lvm.conf.5.
Petr Rockai [Mon, 19 Nov 2012 15:19:58 +0000 (16:19 +0100)]
Document use_lvmetad and global_filter in lvm.conf.5.

11 years agotest: testing lvconvert
Zdenek Kabelac [Mon, 19 Nov 2012 11:31:11 +0000 (12:31 +0100)]
test: testing lvconvert

11 years agothin: man page updates
Zdenek Kabelac [Tue, 30 Oct 2012 17:11:59 +0000 (17:11 +0000)]
thin: man page updates

Cover latest extensions of lvconvert functionality.
Update also lvcreate page.

11 years agothin: lvcreate use common functions
Zdenek Kabelac [Mon, 19 Nov 2012 11:47:34 +0000 (12:47 +0100)]
thin: lvcreate use common functions

Use common functions from toollib and eliminate code from here.

11 years agothin: lvconvert update
Zdenek Kabelac [Mon, 19 Nov 2012 12:37:57 +0000 (13:37 +0100)]
thin: lvconvert update

Use common function from toollib and support allocation
of metadata LV with give thin pool data LV.

11 years agothin: add alloc_pool_metadata
Zdenek Kabelac [Mon, 19 Nov 2012 12:37:36 +0000 (13:37 +0100)]
thin: add alloc_pool_metadata

Since our api call is not yet powerfull enough,
use this wrapper to preset options.

11 years agothin: add common pool functions
Zdenek Kabelac [Thu, 15 Nov 2012 13:48:32 +0000 (14:48 +0100)]
thin: add common pool functions

Move common functions for lvcreate and lvconvert.

get_pool_params() - read thin pool args.
update_pool_params() - updates/validates some thin args.

It is getting complicated and even few more things will be
implemented, so to avoid reimplementing things differently
in lvcreate and lvconvert  code has been splitted
into 2 common functions that allow some future extension.

This page took 0.077631 seconds and 5 git commands to generate.