]> sourceware.org Git - lvm2.git/log
lvm2.git
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.

11 years agoliblvm: internal API change
Zdenek Kabelac [Tue, 13 Nov 2012 09:49:32 +0000 (10:49 +0100)]
liblvm: internal API change

Return LV/NULL instead of 1/0 which saves lookup for created LV.

11 years agolvconvert: store target attributes
Zdenek Kabelac [Thu, 15 Nov 2012 09:32:13 +0000 (10:32 +0100)]
lvconvert: store target attributes

Target tells us its version, and we may allow different set of options
to be supported with different version of driver.

Idea is to provide individual feature flags and later be
able to query for them.

11 years agocleanup: move setting of parameter zero
Zdenek Kabelac [Thu, 15 Nov 2012 13:47:37 +0000 (14:47 +0100)]
cleanup: move setting of parameter zero

Since we may need to use different default value,
move read of zero_ARG prior processing of parameters.

11 years agomirror: Mirrored log should be fixed before mirror when double fault occurs
Jonathan Brassow [Wed, 14 Nov 2012 20:58:47 +0000 (14:58 -0600)]
mirror:  Mirrored log should be fixed before mirror when double fault occurs

This patch is intended to fix bug 825323 - FS turns read-only during a double
fault of a mirror leg and mirrored log's leg at the same time.  It only
affects a 2-way mirror with a mirrored log.  3+-way mirrors and mirrors
without a mirrored log are not affected.

The problem resulted from the fact that the top level mirror was not
using 'noflush' when suspending before its "down-convert".  When a
mirror image fails, the bios are queue until a suspend is recieved.  If
it is a 'noflush' suspend, the bios can be safely requeued in the DM
core.  If 'noflush' is not used, the bios must be pushed through the
target and if a device is failed for a mirror, that means issuing an
error.  When an error is received by a file system, it results in it
turning read-only (depending on the FS).

Part of the problem was is due to the nature of the stacking involved in
using a mirror as a mirror's log.  When an image in each fail, the top
level mirror stalls because it is waiting for a log flush.  The other
stalls waiting for corrective action.  When the repair command is issued,
the entire stacked arrangement is collapsed to a linear LV.  The log
flush then fails (somewhat uncleanly) and the top-level mirror is suspended
without 'noflush' because it is a linear device.

This patch allows the log to be repaired first, which in turn allows the
top-level mirror's log flush to complete cleanly.  The top-level mirror
is then secondarily reduced to a linear device - at which time this mirror
is suspended properly with 'noflush'.

11 years agopython-lvm: Initial check-in of python-lvm unit test case.
Tony Asleson [Fri, 26 Oct 2012 20:35:17 +0000 (15:35 -0500)]
python-lvm: Initial check-in of python-lvm unit test case.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agotest: set LD_LIBRARY_PATH to all dirs with *.so
Tony Asleson [Fri, 26 Oct 2012 20:30:21 +0000 (15:30 -0500)]
test: set LD_LIBRARY_PATH to all dirs with *.so

Instead of manually editing entries, add all the
directories which contain shared objects.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agopvscan: exit --cache immediately if locking_type=3 || use_lvmetad=0
Peter Rajnoha [Fri, 9 Nov 2012 14:56:57 +0000 (15:56 +0100)]
pvscan: exit --cache immediately if locking_type=3 || use_lvmetad=0

11 years agosystemd: remove quotes in lvm2-monitor.service ExecStop
Peter Rajnoha [Fri, 2 Nov 2012 19:32:28 +0000 (20:32 +0100)]
systemd: remove quotes in lvm2-monitor.service ExecStop

11 years agosystemd: do not remove lvm2-activation.service
Peter Rajnoha [Thu, 1 Nov 2012 12:33:49 +0000 (13:33 +0100)]
systemd: do not remove lvm2-activation.service

Fix previous commit 360c569ce8f0bfe936d59ca91de2716958550524.
Remove only fedora-storage-init/fedora-storage-init-late.service, but
not lvm2-activation.service.
fedora-storage-init.service fedora-storage-init-late.service

11 years agosystemd: various updates and fixes
Peter Rajnoha [Tue, 30 Oct 2012 19:36:49 +0000 (20:36 +0100)]
systemd: various updates and fixes

Don't use lvmetad in lvm2-monitor.service ExecStop to avoid a systemd issue.
 - a systemd design issue while processing dependencies
   with socket-based activation that ends up with a hang
 - https://bugzilla.redhat.com/show_bug.cgi?id=843587
   (also tracker bug https://bugzilla.redhat.com/show_bug.cgi?id=871527)
 - not using lvmetad in this case is just a workaround, once the bug
   above is resolved, we should enable the lvmetad in that specific case

Remove dependency on fedora-storage-init.service in lvm2 systemd units.
 - fedora-storage-init.service and fedora-storage-init-late.service is
   going to be separated into respective units that belong to each block
   device subsystem:
     - mpath + mdraid activated via udev solely
     - dmraid with its own dmraid-activation.service unit
     - lvm2 with the lvm2-activation-generator to generate the
       activation units runtime if lvmetad disabled
       (global/use_lvmetad=0 set in lvm.conf) and activation done
       via udev+lvmetad if lvmetad enabled (global/use_lvmetad=1 set
       in lvm.conf)

Depend on lvm2-lvmetad.socket in lvm2-monitor.service systemd unit.
 - as lvm2-monitor uses lvmetad if lvmetad is enabled

11 years agotest: Check that overriding use_lvmetad with --config works.
Petr Rockai [Tue, 30 Oct 2012 08:16:15 +0000 (09:16 +0100)]
test: Check that overriding use_lvmetad with --config works.

11 years agolvmetad: Init lazily, to avoid socket access on config overrides.
Petr Rockai [Mon, 29 Oct 2012 20:39:46 +0000 (21:39 +0100)]
lvmetad: Init lazily, to avoid socket access on config overrides.

11 years agolvmetad: warn only if use_lvmetad=1 and locking_type=3
Peter Rajnoha [Mon, 29 Oct 2012 15:20:35 +0000 (16:20 +0100)]
lvmetad: warn only if use_lvmetad=1 and locking_type=3

11 years agopython-lvm: Memory leaks & seg. fault fixes
Tony Asleson [Thu, 25 Oct 2012 22:31:11 +0000 (17:31 -0500)]
python-lvm: Memory leaks & seg. fault fixes

Issues found (thus far) in unit test developemnt for python bindings.

Added Py_DECREF(ptr) in liblvm_lvm_vg_open & liblvm_lvm_vg_create
in error paths so that we correctly clean up memory.

Added a call to lvm_vg_close when we remove a vg.  The code was
clearing out the vg pointer which prevented us from actually
calling lvm_vg_close in the close path.

liblvm_lvm_vg_create_lv_linear was not initializing
lvobj->parent_vgobj and if lvm_vg_create_lv_linear failed
we went through liblvm_lv_dealloc on clean up and tried to
Py_DECREF an invalid pointer.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agoWHATS_NEW: latest changes under libdm 1.02.78
Peter Rajnoha [Thu, 25 Oct 2012 14:29:35 +0000 (16:29 +0200)]
WHATS_NEW: latest changes under libdm 1.02.78

11 years agolvmetad: whats_new + more explanation for previous commit
Peter Rajnoha [Thu, 25 Oct 2012 12:47:45 +0000 (14:47 +0200)]
lvmetad: whats_new + more explanation for previous commit

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