]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agodmeventd: prevent busy looping on CPU
Zdenek Kabelac [Thu, 22 Mar 2012 16:00:25 +0000 (17:00 +0100)]
dmeventd: prevent busy looping on CPU

Use usleep when looping on DM_WAIT_RETRY.

10 years agodmeventd: change locking code
Zdenek Kabelac [Sun, 30 Jun 2013 14:07:26 +0000 (16:07 +0200)]
dmeventd: change locking code

Ensure global lock is being hold when working with thread->.

10 years agodmeventd: drop taking timeout mutex
Zdenek Kabelac [Sun, 30 Jun 2013 14:06:39 +0000 (16:06 +0200)]
dmeventd: drop taking timeout mutex

Taking _timeout_mutex is not needed when registering and unregistering.
Global mutex is already being hold for this case.

10 years agothin: enable build of thin provisioning by default
Zdenek Kabelac [Thu, 12 Dec 2013 12:07:59 +0000 (13:07 +0100)]
thin: enable build of thin provisioning by default

Use internal type by default for thin provisioning.
If user is not interested in thin provisiong and doesn't
have thin provisining supporting tools installed,
configure will just print warning at the end of configure
process about limited support.

10 years agocleanup: add missing backtrace in fail path
Zdenek Kabelac [Tue, 10 Dec 2013 19:49:53 +0000 (20:49 +0100)]
cleanup: add missing backtrace in fail path

10 years agocleanup: improve tag processing
Zdenek Kabelac [Tue, 8 Nov 2011 22:29:40 +0000 (23:29 +0100)]
cleanup: improve tag processing

Boolean algebra changes for process_each_lv_in_vg().

1st.
Drop process_lv variable since it's not needed.

2nd.
process_lv was always initilized to 0 - so the condition was always true.
It the condition (!tags_supplied && !lvargs_supplied) evaluates as "true",
process_all is already set to 1, so skip vg tags evaluation.

3rd.
Move check for matching lv name in the front of lv tags check
since this check can't be skipped for lvargs_matched counter.
If this filter evaluates to true, skip lv tags evaluation.

10 years agocleanup: remove duplicate code
Zdenek Kabelac [Wed, 30 Nov 2011 10:30:33 +0000 (11:30 +0100)]
cleanup: remove duplicate code

As dev_name_confirmed() has check for DEV_REGULAR
remove this duplicated extra check prior its call.

10 years agocleanup: self compilable headers
Zdenek Kabelac [Wed, 25 Jan 2012 22:26:33 +0000 (23:26 +0100)]
cleanup: self compilable headers

10 years agocleanup: simplify logging code
Zdenek Kabelac [Mon, 26 Mar 2012 11:50:44 +0000 (13:50 +0200)]
cleanup: simplify logging code

Condense code for logging.

10 years agoWHATS_NEW: commit 4c267c7286145165dfe078f77d18d194a21a2e1c
Peter Rajnoha [Wed, 11 Dec 2013 15:50:52 +0000 (16:50 +0100)]
WHATS_NEW: commit 4c267c7286145165dfe078f77d18d194a21a2e1c

See also https://bugzilla.redhat.com/show_bug.cgi?id=1026860
for more info, comment 76 for summary.

10 years agoudev: fix SYSTEMD_READY assignment for foreign devices in lvmetad rules
Peter Rajnoha [Wed, 11 Dec 2013 12:13:21 +0000 (13:13 +0100)]
udev: fix SYSTEMD_READY assignment for foreign devices in lvmetad rules

Some devices, similarly to us, are not prepared after ADD event, but
after an extra CHANGE event when the device is properly set up.
This includes MD and loop devices. This patch fixes the
SYSTEMD_READY assignment that is crucial for proper functionality
of SYSTEMD_WANTS that we use to instantiate a lvm2-pvscan@.service
systemd service to activate the VG/LVs (see also bug
info).

All that extra handling of foreign devices should eventually be moved
to rules which process those devices primarily (MD and loop)! We should
only check a dedicated variable whether the device is usable or not.

10 years agotests: count interrupted test as failed
Zdenek Kabelac [Tue, 10 Dec 2013 10:21:40 +0000 (11:21 +0100)]
tests: count interrupted test as failed

10 years agothin: thin metadata resize unsupported with 1.9
Zdenek Kabelac [Tue, 10 Dec 2013 10:10:53 +0000 (11:10 +0100)]
thin: thin metadata resize unsupported with 1.9

Thin kernel target 1.9 still does not support online resize of
thin pool metadata properly - so disable it with expectation
for much higher version - and reenable after fixing kernel.

10 years agocleanup: share segtype macros
Zdenek Kabelac [Tue, 10 Dec 2013 09:45:21 +0000 (10:45 +0100)]
cleanup: share segtype macros

Write query macro just once.

10 years agocleanup: shorter raid initialization
Zdenek Kabelac [Fri, 6 Dec 2013 15:38:11 +0000 (16:38 +0100)]
cleanup: shorter raid initialization

Avoid multiple queries for raid library for each initialized raid
seg type and use shorter code.

10 years agocleanup: tiny speedup of lib_dir checking
Zdenek Kabelac [Fri, 6 Dec 2013 15:35:54 +0000 (16:35 +0100)]
cleanup: tiny speedup of lib_dir checking

Instead of repeated lookup of global/library_dir - remember first
search in command context - saves couple lines in debug output...

10 years agoconf: clarify wipe_signatures_when_zeroing_new_lvs
Peter Rajnoha [Tue, 10 Dec 2013 09:16:37 +0000 (10:16 +0100)]
conf: clarify wipe_signatures_when_zeroing_new_lvs

10 years agoconfig: shorten new sig wiping option string
Alasdair G Kergon [Mon, 9 Dec 2013 09:35:47 +0000 (09:35 +0000)]
config: shorten new sig wiping option string

Rename wipe_signatures_on_new_logical_volumes_when_zeroing  to
wipe_signatures_when_zeroing_new_lvs.

10 years agotests: more limits for python test
Zdenek Kabelac [Fri, 6 Dec 2013 09:37:49 +0000 (10:37 +0100)]
tests: more limits for python test

It will be most probably more problem with
incomplete initialization of lvm.conf settings
when lvm2app is in use.

Skip cluster & lvmetad test for now.

10 years agotests: python test needs dmeventd
Zdenek Kabelac [Fri, 6 Dec 2013 09:07:22 +0000 (10:07 +0100)]
tests: python test needs dmeventd

Until lvm2app respects all lvm.conf setting,
this test require dmeventd.

10 years agolvmdump: follow symbolic links in /etc/lvm
Peter Rajnoha [Thu, 5 Dec 2013 15:36:45 +0000 (16:36 +0100)]
lvmdump: follow symbolic links in /etc/lvm

10 years agocompile/link: EXTRA_EXEC_CFLAGS must be applied for *.o
Peter Rajnoha [Thu, 5 Dec 2013 13:19:10 +0000 (14:19 +0100)]
compile/link: EXTRA_EXEC_CFLAGS must be applied for *.o

10 years agocompile/link: use RELRO/PIE compiler/linker options for executables
Peter Rajnoha [Thu, 5 Dec 2013 13:03:10 +0000 (14:03 +0100)]
compile/link: use RELRO/PIE compiler/linker options for executables

10 years agotests: sysrq only when stuck with no output.
Zdenek Kabelac [Thu, 5 Dec 2013 11:32:27 +0000 (12:32 +0100)]
tests: sysrq only when stuck with no output.

If we are stuck in user for too long without output,
grab kernel stack traces.
If we just produce too many lines of output, it's
not probably kernel related bug.

10 years agotests: do not run lvmetad tests without lvmetad
Zdenek Kabelac [Thu, 5 Dec 2013 11:31:49 +0000 (12:31 +0100)]
tests: do not run lvmetad tests without lvmetad

Skip tests when lvmetad is not compiled.

10 years agolv_remove_single: update parameter name
Zdenek Kabelac [Thu, 5 Dec 2013 11:39:02 +0000 (12:39 +0100)]
lv_remove_single: update parameter name

Since we have already a meaning for 'silent'
replace its name with more explanator suppress_remove_message
(updates recent commit).

10 years agotests: harness prints debug.log
Zdenek Kabelac [Thu, 5 Dec 2013 10:12:56 +0000 (11:12 +0100)]
tests: harness prints debug.log

When the test is interrupted because debug.log has got to big,
and the test doesn't react on SIGINT - and needs to be only
killed with SIGKILL - it's still valuable to print at least
a portion of this debug.log (currently 4MB).

LVM_TEST_UNLIMITED  could be set to avoid this limitation
(i.e. when busy-looping lvm command needs to be running
for gdb attachment)

10 years agodev-cache: return success when ignoring dirs
Zdenek Kabelac [Thu, 5 Dec 2013 10:11:26 +0000 (11:11 +0100)]
dev-cache: return success when ignoring dirs

When there is no failure from the insert operation itself,
just dirs and links are skipped - return success.

10 years agocleanup: gcc can't see the code path
Zdenek Kabelac [Thu, 5 Dec 2013 08:41:03 +0000 (09:41 +0100)]
cleanup: gcc can't see the code path

This is a bit to hard for gcc to see the condition can't
be triggered, so make it easier and initialize to 0.

10 years agolvmetad: remove unused override variables
Alasdair G Kergon [Thu, 5 Dec 2013 01:13:18 +0000 (01:13 +0000)]
lvmetad: remove unused override variables

10 years agolibdm: prevent empty config file section names
Alasdair G Kergon [Thu, 5 Dec 2013 01:09:03 +0000 (01:09 +0000)]
libdm: prevent empty config file section names

Change c35394959758ec17389529f95a33bf7f5b15c56b to use existing
_dup_string_tok().  alloca() doesn't fail cleanly (and needs
replacing.)

10 years agotests: drop RUN... already have this var elsewhere
Zdenek Kabelac [Wed, 4 Dec 2013 20:37:33 +0000 (21:37 +0100)]
tests: drop RUN... already have this var elsewhere

10 years agotests: replace built-in popen
Zdenek Kabelac [Wed, 4 Dec 2013 18:50:53 +0000 (19:50 +0100)]
tests: replace built-in popen

It seems some older bashes have problems to properly execute
both pipes - so replace this code with separate temporary files.

10 years agotests: reuse timeout code for too long debug.log
Zdenek Kabelac [Wed, 4 Dec 2013 18:48:29 +0000 (19:48 +0100)]
tests: reuse timeout code for too long debug.log

Jump to the same code used for timeout when no output
is made for long time.

Increase the allowed debug.log size to 32MB.

10 years agotests: update pvmove-test
Zdenek Kabelac [Wed, 4 Dec 2013 16:05:44 +0000 (17:05 +0100)]
tests: update pvmove-test

Do not lock test when trying to grab cluster lock.
There seems to be still something weird in this test
so it still needs some inspection.

10 years agotests: monitor debug.log size
Zdenek Kabelac [Wed, 4 Dec 2013 16:01:59 +0000 (17:01 +0100)]
tests: monitor debug.log size

Show testing directory from test and monitor it in
harness - so when it gets too big - kill test.

10 years agovgchange: move detection of remote exlusivness
Zdenek Kabelac [Thu, 28 Nov 2013 22:22:03 +0000 (23:22 +0100)]
vgchange: move detection of remote exlusivness

Since activation takes only read-lock, there could be
multiple activation running in parallel.

So instead of checking before taking any real lock,
let the locking resolve the problem and just
detect if the reason for failure has been remote
exlusive activation.

It should be also faster, since each activation does
not need to do explicit lock query.

10 years agoconfigure: also LDFLAGS, not LDLAGS for proper restore
Peter Rajnoha [Wed, 4 Dec 2013 13:58:40 +0000 (14:58 +0100)]
configure: also LDFLAGS, not LDLAGS for proper restore

10 years agotest: thin snapshot merge
Zdenek Kabelac [Wed, 4 Dec 2013 13:17:54 +0000 (14:17 +0100)]
test: thin snapshot merge

Testing thin snapshot merge cases.
TODO: Probably still misses some cases.

10 years agothin: enable thin snapshot merge
Zdenek Kabelac [Fri, 29 Nov 2013 20:28:18 +0000 (21:28 +0100)]
thin: enable thin snapshot merge

10 years agothin: activation of merging thin snapshot
Zdenek Kabelac [Fri, 29 Nov 2013 20:25:58 +0000 (21:25 +0100)]
thin: activation of merging thin snapshot

For merging thin snapshot we have to do couple extra
checks before we allow this operation.

We pretend  thin-snapshot and thin-origin
are tied together and we have to properly
maintain locking.

10 years agothin: merge display
Zdenek Kabelac [Fri, 29 Nov 2013 14:54:51 +0000 (15:54 +0100)]
thin: merge display

10 years agothin: deactivation of merging thin snapshot
Zdenek Kabelac [Fri, 29 Nov 2013 20:22:55 +0000 (21:22 +0100)]
thin: deactivation of merging thin snapshot

Before trying to deactivate merging thin snapshot
(which is invisible) check if it's not in-use.

10 years agothin: merge removal
Zdenek Kabelac [Fri, 29 Nov 2013 20:21:00 +0000 (21:21 +0100)]
thin: merge removal

When thin is merged - properly handly device removal.

10 years agothin: merge support for device tree
Zdenek Kabelac [Fri, 29 Nov 2013 20:18:34 +0000 (21:18 +0100)]
thin: merge support for device tree

When thin snapshot merge is requested, tree must detect
if user tries to active such LV while origin or
snapshost is still active.

10 years agothin: snapshot merge support
Zdenek Kabelac [Fri, 29 Nov 2013 14:51:28 +0000 (15:51 +0100)]
thin: snapshot merge support

10 years agothin: read table line with thin device id
Zdenek Kabelac [Wed, 4 Dec 2013 12:57:27 +0000 (13:57 +0100)]
thin: read table line with thin device id

Add functions to parse thin table line to
obtain thin device id.

10 years agomerge: test only for meging origin
Zdenek Kabelac [Fri, 29 Nov 2013 10:01:02 +0000 (11:01 +0100)]
merge: test only for meging origin

It's enough to check only for merging origin.
This will be also used for thin volume merges which
do not need to be origins.

10 years agocleanup: size is already 64bit value
Zdenek Kabelac [Fri, 9 Nov 2012 12:18:43 +0000 (13:18 +0100)]
cleanup: size is already 64bit value

Cast is not needed.

10 years agocleanup: swap condition logic
Zdenek Kabelac [Fri, 29 Nov 2013 19:29:38 +0000 (20:29 +0100)]
cleanup: swap condition logic

Use easier to follow logic of code.
When checking for merging origin, do a merging.

10 years agocleanup: code move
Zdenek Kabelac [Fri, 29 Nov 2013 16:20:56 +0000 (17:20 +0100)]
cleanup: code move

Move _swap_lv_identifiers() above  _finish_lvconvert_merge()
so it could be used from this function.

10 years agolv_remove_single: add silent arg
Zdenek Kabelac [Fri, 29 Nov 2013 16:00:55 +0000 (17:00 +0100)]
lv_remove_single: add silent arg

Support silence for removal message.

10 years agosnapshots: use lv_check_not_in_use
Zdenek Kabelac [Fri, 29 Nov 2013 14:02:57 +0000 (15:02 +0100)]
snapshots: use lv_check_not_in_use

Switch from a simple 'open_count' test on opened snaphost
to a more 'skilled'  lv_check_not_in_use().

10 years agorefresh: print error message with failing lv name
Zdenek Kabelac [Fri, 29 Nov 2013 10:10:41 +0000 (11:10 +0100)]
refresh: print error message with failing lv name

If there is  suspend/resume error, print error message
with lv name.
Drop goto.

10 years agomake: CFLAGS, not CLDFLAGS
Peter Rajnoha [Wed, 4 Dec 2013 13:28:40 +0000 (14:28 +0100)]
make: CFLAGS, not CLDFLAGS

10 years agodaemons: use PIE and RELRO compiler/linker options
Peter Rajnoha [Wed, 4 Dec 2013 09:16:15 +0000 (10:16 +0100)]
daemons: use PIE and RELRO compiler/linker options

The PIE and RELRO compiler/linker options can be used to produce a code
some techniques applied that makes the code more immune to some attacks:

  - PIE (Position Independent Executable). It can make use of the ASLR
    (Address Space Layout Randomization) provided by kernel to avoid
    static locations for .text regions of executables (this is the 'pie'
    compiler and linker option)

  - RELRO (Relocation Read-Only). This prevents overwrite attacks of
    the GOT (Global Offset Table) and PLT (Procedure Lookup Table)
    used for relocations by making it read-only after all relocations
    are resolved (these are the 'relro' and 'now' linker options) -
    hence all symbols are resolved at the very start so there's no
    need for those tables to be writeable later.

These compiler/linker options are now used by default for daemons
if the compiler/linker supports it.

10 years agomake: support per-object defines
Zdenek Kabelac [Wed, 4 Dec 2013 11:35:02 +0000 (12:35 +0100)]
make: support per-object defines

In the case we have a dir with multiple objects and for
an individual object file we need special define -
allow to define it without adding extra rules.

To ensure dmeventd.o compilation will use EXTRA_FLAGS:
CFLAGS_dmeventd.o += $(EXTRA_FLAGS)

Then it's better to use:
dmeventd.o: CFLAGS += $(EXTRA_FLAGS)

10 years agoconfigure: check compiler/linker support for RELRO and PIE options
Peter Rajnoha [Wed, 4 Dec 2013 08:58:58 +0000 (09:58 +0100)]
configure: check compiler/linker support for RELRO and PIE options

Also, add AC_TRY_LDFLAGS m4 macro to help with checking ld flags.

10 years agotests: one LV should be active and one inactive in covercmd test
Peter Rajnoha [Wed, 4 Dec 2013 08:37:32 +0000 (09:37 +0100)]
tests: one LV should be active and one inactive in covercmd test

10 years agolvconvert: Implement --splitsnapshot.
Alasdair G Kergon [Wed, 4 Dec 2013 02:09:37 +0000 (02:09 +0000)]
lvconvert: Implement --splitsnapshot.

10 years agolvconvert: Fix reload after snapshot conversion.
Alasdair G Kergon [Wed, 4 Dec 2013 02:04:29 +0000 (02:04 +0000)]
lvconvert: Fix reload after snapshot conversion.

At the end of lvconvert --snapshot with an active origin, the origin
gets reloaded.

Commit 57c0f72b1d0349382c226c2b5614489b59db99e8 ("lvconvert: use
_reload_lv on more places") accidentally replaced this with a snapshot
LV reload (which does nothing because only the origin is active).

10 years agovgdisplay: select only active volumes groups if -A option is used
Peter Rajnoha [Tue, 3 Dec 2013 13:41:25 +0000 (14:41 +0100)]
vgdisplay: select only active volumes groups if -A option is used

Where "active" means "at least one LV is active in the volume group".

10 years agolibdm-config: Allow quoted section (and key) names.
Petr Rockai [Sun, 1 Dec 2013 19:02:28 +0000 (20:02 +0100)]
libdm-config: Allow quoted section (and key) names.

10 years agopvcreate: Avoid spurious 'not found' messages.
Alasdair G Kergon [Fri, 29 Nov 2013 21:45:37 +0000 (21:45 +0000)]
pvcreate: Avoid spurious 'not found' messages.

Replacement of pv_read by find_pv_by_name in commit
651d5093edde3e0ebee9d75be1c9834efc152d91 caused spurious
error messages when running pvcreate or vgextend against an
unformatted device.

Physical volume /dev/loop4 not found
Physical volume "/dev/loop4" successfully created

Physical volume /dev/loop4 not found
Physical volume /dev/loop4 not found
Physical volume "/dev/loop4" successfully created
Volume group "vg1" successfully extended

10 years agolvmetad: extend socket/pid file handling
Alasdair G Kergon [Fri, 29 Nov 2013 20:56:29 +0000 (20:56 +0000)]
lvmetad: extend socket/pid file handling

Make it easier to run a live lvmetad in debugging mode and
to avoid conflicts if multiple test instances need to be run
alongside a live one.

No longer require -s when -f is used: use built-in default.
Add -p to lvmetad to specify the pid file.
No longer disable pidfile if -f used to run in foreground.
If specified socket file appears to be genuine but stale, remove it
before use.
On error, only remove lvmetad socket file if created by the same
process.  (Previous code removes socket even while a running instance
is using it!)

10 years agoconfigure: require libblkid >= 2.24 for blkid wiping
Peter Rajnoha [Fri, 29 Nov 2013 15:37:09 +0000 (16:37 +0100)]
configure: require libblkid >= 2.24 for blkid wiping

Some symbols/identifiers were defined even later than 2.22, like BLKID_SUBLKS_BADCSUM.

10 years agoconfigure: enable blkid_wiping by default if the blkid library is present
Peter Rajnoha [Fri, 29 Nov 2013 14:27:56 +0000 (15:27 +0100)]
configure: enable blkid_wiping by default if the blkid library is present

10 years agolvmetad: Add newline to missing socket error mesg
Alasdair G Kergon [Thu, 28 Nov 2013 19:16:25 +0000 (19:16 +0000)]
lvmetad: Add newline to missing socket error mesg

10 years agotests: add test for lvcreate signature wiping
Peter Rajnoha [Thu, 28 Nov 2013 14:47:20 +0000 (15:47 +0100)]
tests: add test for lvcreate signature wiping

10 years agotests: wipe fs signature manually in pvcreate-operation test
Peter Rajnoha [Thu, 28 Nov 2013 13:10:55 +0000 (14:10 +0100)]
tests: wipe fs signature manually in pvcreate-operation test

So that the next pvcreate that is called does not issue any
warnings/prompts about existing signature (when blkid wiping is used).

10 years agotests: initialize signature wiping
Peter Rajnoha [Thu, 28 Nov 2013 12:23:45 +0000 (13:23 +0100)]
tests: initialize signature wiping

Do not use signature wiping for newly created LVs in tests - we're
reusing the devs in tests and such detection could just interfere
inappropriately. We'd need to modify all tests to anwer the prompt
whether any signature found should be removed or not or we'd need
to use "-y" option for all lvcreates in tests. It's better to disable
this feature then and let's do a separate test to test this signature
wiping functionality.

10 years agopvcreate: do not issue warning about any existing PV
Peter Rajnoha [Thu, 28 Nov 2013 12:14:46 +0000 (13:14 +0100)]
pvcreate: do not issue warning about any existing PV

If we're calling pvcreate on a device that already has a PV label,
the blkid detects the existing PV and then we consider it for wiping
before we continue creating the new PV label and we issue a warning
with a prompt whether such old PV label should be removed. We don't
do this with native signature detection code. Let's make it consistent
with old behaviour.

But still keep this "PV" (identified as "LVM1_member" or "LVM2_member"
by blkid) detection when creating new LVs to avoid unexpected PV label
appeareance inside LV.

10 years agocleanup: tab indent
Zdenek Kabelac [Thu, 28 Nov 2013 10:35:53 +0000 (11:35 +0100)]
cleanup: tab indent

10 years agocleanup: convert log_error with log_warn
Zdenek Kabelac [Mon, 25 Nov 2013 13:34:34 +0000 (14:34 +0100)]
cleanup: convert log_error with log_warn

Collapse 2 ifs and replace log_error() with log_warn(), since\
the reported message is not causing tools error.
(and cannot be probably triggered anyway).

10 years agocleanup: convert log_sys_error to log_sys_debug
Zdenek Kabelac [Mon, 25 Nov 2013 12:46:34 +0000 (13:46 +0100)]
cleanup: convert log_sys_error to log_sys_debug

Use debug for those error reports which do not lead to error return
call.

10 years agocleanup: move declaration to the front
Zdenek Kabelac [Mon, 25 Nov 2013 12:43:25 +0000 (13:43 +0100)]
cleanup: move declaration to the front

10 years agocleanup: use matching signed types
Zdenek Kabelac [Mon, 25 Nov 2013 12:42:30 +0000 (13:42 +0100)]
cleanup: use matching signed types

10 years agocleanup: drop extra dm_list_empty
Zdenek Kabelac [Sun, 24 Nov 2013 18:03:29 +0000 (19:03 +0100)]
cleanup: drop extra dm_list_empty

Since dm_list_first has this check already include,
skip extra call in while().
Moreover analyzers are then sure pvl is not NULL.

10 years agocleanup: fold test into printf arg
Zdenek Kabelac [Sun, 24 Nov 2013 17:59:46 +0000 (18:59 +0100)]
cleanup: fold test into printf arg

When arg is folded, compiler is able to check all args.
(better for security)

10 years agocleanup: use compound literals for wipe_lv
Zdenek Kabelac [Thu, 28 Nov 2013 10:22:24 +0000 (11:22 +0100)]
cleanup: use compound literals for wipe_lv

Optimize and cleanup recently introduced new function wipe_lv.
Use compound literals to get nicely initialized wipe_params struct.
Pass in lv as explicit argument for wipe_lv.
Use cmd from lv structure.
Initialize only non-null members so it's easy to see what
is the special arg.

10 years agotoollib: drop init of ret
Zdenek Kabelac [Fri, 22 Nov 2013 21:27:32 +0000 (22:27 +0100)]
toollib: drop init of ret

Keep the ret uninitialized, so we get compiler warning, when tried
to use this value instead of ret_max as function return value.

10 years agosnapshot: move code of old snapshot merge
Zdenek Kabelac [Tue, 26 Nov 2013 11:09:41 +0000 (12:09 +0100)]
snapshot: move code of old snapshot merge

Move code for merging old snapshot into its own function.

10 years agodmeventd: simplify error path
Zdenek Kabelac [Mon, 25 Nov 2013 13:24:25 +0000 (14:24 +0100)]
dmeventd: simplify error path

Use common 'bad:' label for exit error path where
fifo is closed before exit().

10 years agodmeventd: fifo init and close cleanup
Zdenek Kabelac [Thu, 28 Nov 2013 11:21:06 +0000 (12:21 +0100)]
dmeventd: fifo init and close cleanup

Use structure initialization for easier to read code.
Close only descriptors >= 0.

10 years agoconfig: use int for type
Zdenek Kabelac [Mon, 25 Nov 2013 12:44:46 +0000 (13:44 +0100)]
config: use int for type

Since the type is used for 'or' operation of enumerated bit fields,
it doesn't not have type cfg_def_type_t - use proper int type for
bitmask.

10 years agosnapshot: drop find_merging_snapshot
Zdenek Kabelac [Thu, 28 Nov 2013 10:39:38 +0000 (11:39 +0100)]
snapshot: drop find_merging_snapshot

Drop find_merging_snapshot() function. Use find_snapshot()
called after check for lv_is_merging_origin() which
is the commonly used code path - so we avoid duplicated
tests and potential risk of derefering NULL point
in unhandled error path.

10 years agoformat-text: ensure aligment is not 0
Zdenek Kabelac [Sun, 24 Nov 2013 18:00:53 +0000 (19:00 +0100)]
format-text: ensure aligment is not 0

Make sure this path of code is not used for alignment == 0,
to prevent division by 0.

10 years agoprofile: wipe_signatures_on_new_logical_volumes_when_zeroing not yet profilable
Peter Rajnoha [Wed, 27 Nov 2013 15:49:12 +0000 (16:49 +0100)]
profile: wipe_signatures_on_new_logical_volumes_when_zeroing not yet profilable

But it might be - needs more testing...

10 years agoman: lvcreate -W/--wipesignatures
Peter Rajnoha [Wed, 27 Nov 2013 14:20:12 +0000 (15:20 +0100)]
man: lvcreate -W/--wipesignatures

10 years agowiping: add support for blkid wiping
Peter Rajnoha [Fri, 15 Nov 2013 13:50:02 +0000 (14:50 +0100)]
wiping: add support for blkid wiping

This is actually the wipefs functionailty as a matter of fact
(wipefs uses the same libblkid calls).

libblkid is more rich when it comes to detecting various
signatures, including filesystems and users can better
decide what to erase and what should be kept.

The code is shared for both pvcreate (where wiping is necessary
to complete the pvcreate operation) and lvcreate where it's up
to the user to decide.

The verbose output contains a bit more information about the
signature like LABEL and UUID.

For example:
  raw/~ # lvcreate -L16m vg
  WARNING: linux_raid_member signature detected on /dev/vg/lvol0 at offset 4096. Wipe it? [y/n]

or more verbose one:
  raw/~ # lvcreate -L16m vg -v
  ...
     Found existing signature on /dev/vg/lvol0 at offset 4096: LABEL="raw.virt:0" UUID="da6af139-8403-5d06-b8c4-13f6f24b73b1" TYPE="linux_raid_member" USAGE="raid"
WARNING: linux_raid_member signature detected on /dev/vg/lvol0 at offset 4096. Wipe it? [y/n]

The verbose output is the same output as found in blkid.

10 years agoconf: add allocation/use_blkid_wiping
Peter Rajnoha [Wed, 27 Nov 2013 12:52:15 +0000 (13:52 +0100)]
conf: add allocation/use_blkid_wiping

Add allocation/use_blkid_wiping setting to lvm.conf to select between
LVM2 native code to detect signatures to wipe or blkid library code.

10 years agoconfigure: add --enable-blkid_wiping
Peter Rajnoha [Thu, 14 Nov 2013 13:03:24 +0000 (14:03 +0100)]
configure: add --enable-blkid_wiping

10 years agolv_manip: rename set_lv -> wipe_lv and include signature wiping capability
Peter Rajnoha [Wed, 6 Nov 2013 15:16:34 +0000 (16:16 +0100)]
lv_manip: rename set_lv -> wipe_lv and include signature wiping capability

Use common wipe_lv (former set_lv) fn to do zeroing as well as signature
wiping if needed. Provide new struct wipe_lv_params to define the
functionality.

Bind "lvcreate -W/--wipesignatures y" with proper wipe_lv call.

Also, add "yes" and "force" to lvcreate_params so it's possible
to apply them for the prompt: "WARNING: %s detected on %s. Wipe it? [y/n]".

10 years agolvcreate: recognize --wipesignatures arg
Peter Rajnoha [Wed, 6 Nov 2013 15:05:50 +0000 (16:05 +0100)]
lvcreate: recognize --wipesignatures arg

Recognize the new --wipesignatures arg in lvcreate that is supposed
to wipe known signatures if found on newly created LV.

10 years agoconf: add allocation/wipe_signatures_on_new_logical_volumes_when_zeroing
Peter Rajnoha [Wed, 27 Nov 2013 11:54:48 +0000 (12:54 +0100)]
conf: add allocation/wipe_signatures_on_new_logical_volumes_when_zeroing

This setting controls whether signature wiping on newly created logical
volumes will follow the state of zeroing (-Z/--zero option).

10 years agodevice: cleanup signature wiping functions
Peter Rajnoha [Wed, 6 Nov 2013 14:09:29 +0000 (15:09 +0100)]
device: cleanup signature wiping functions

The wipe_known_signatures fn now wraps the _wipe_signature fn that is called
for each known signature (currently md, swap and luks). This patch makes the
code more readable, not repeating the same sequence when used anywhere in the
code. We're going to reuse this code later...

10 years agoactivation: change log_error to log_warn if refresh before autoactivation fails
Peter Rajnoha [Wed, 27 Nov 2013 07:53:26 +0000 (08:53 +0100)]
activation: change log_error to log_warn if refresh before autoactivation fails

10 years agoWHATS_NEW: commit 729b104
Peter Rajnoha [Wed, 27 Nov 2013 07:33:02 +0000 (08:33 +0100)]
WHATS_NEW: commit 729b104

10 years agoactivation: continue with autoactivation if refresh fails
Peter Rajnoha [Wed, 27 Nov 2013 07:20:02 +0000 (08:20 +0100)]
activation: continue with autoactivation if refresh fails

If the refresh fails for any reason before autoactivation, let's not
make this a stopper for autoactivation itself - just log the error
message if it appears.

The reason is that in some rare situations, we can still hit the
problem with the suspend call to fail (as already described in
commit d8085edf65006a50608edb821b3d30947abaa838, also
https://bugzilla.redhat.com/show_bug.cgi?id=1027314). The refresh
itself is done for only one reason - to refresh any dm tables
for LVs for which the underlying PVs got unplugged/disconnected
and then plugged/connected back (see also
https://bugzilla.redhat.com/show_bug.cgi?id=954061 for more info).
In this case, the major:minor pair is changed and we need to
update dm tables for LVs accordingly.

Now if refresh fails, the error is still logged, but autoactivation
continues.

10 years agolv/vgchange: do not try to connect to lvmetad if socket absent and --sysinit -aay...
Peter Rajnoha [Tue, 26 Nov 2013 13:51:23 +0000 (14:51 +0100)]
lv/vgchange: do not try to connect to lvmetad if socket absent and --sysinit -aay used

If using lv/vgchange --sysinit -aay and lvmetad is enabled, we'd like to
avoid the direct activation and rely on autoactivation instead so
it fits system initialization scripts.

But if we're calling lv/vgchange --sysinit -aay too early when even
lvmetad service is not started yet, we just need to do the direct
activation instead without printing any error messages (while
trying to connect to lvmetad and not finding its socket).

This patch adds two helper functions - "lvmetad_socket_present" and
"lvmetad_used" which can be used to check for this condition properly
and avoid these lvmetad connections when the socket is not present
(and hence lvmetad is not yet running).

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