]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agoconfig: add CFG_DEFAULT_RUN_TIME for config options with runtime defaults
Peter Rajnoha [Mon, 3 Mar 2014 11:34:11 +0000 (12:34 +0100)]
config: add CFG_DEFAULT_RUN_TIME for config options with runtime defaults

Previously, we declared a default value as undefined ("NULL") for
settings which require runtime context to be set first (e.g. settings
for paths that rely on SYSTEM_DIR environment variable or they depend
on any other setting in some way).

If we want to output default values as they are really used in runtime,
we should make it possible to define a default value as function which
is evaluated, not just providing a firm constant value as it was before.

This patch defines simple prototypes for such functions. Also, there's
new helper macros "cfg_runtime" and "cfg_array_runtime" - they provide
exactly the same functionality as the original "cfg" and "cfg_array"
macros when defining the configuration settings in config_settings.h,
but they don't set the constant default value. Instead, they automatically
link the configuration setting definition with one of these functions:

  typedef int (*t_fn_CFG_TYPE_BOOL) (struct cmd_context *cmd, struct profile *profile);
  typedef int (*t_fn_CFG_TYPE_INT) (struct cmd_context *cmd, struct profile *profile);
  typedef float (*t_fn_CFG_TYPE_FLOAT) (struct cmd_context *cmd, struct profile *profile);
  typedef const char* (*t_fn_CFG_TYPE_STRING) (struct cmd_context *cmd, struct profile *profile);
  typedef const char* (*t_fn_CFG_TYPE_ARRAY) (struct cmd_context *cmd, struct profile *profile);

(The new macros actually set the CFG_DEFAULT_RUNTIME flag properly and
set the default value link to the function accordingly).

Then such configuration setting requires a function of selected type to
be defined. This function has a predefined name:

  get_default_<id>

...where the <id> is the id of the setting as defined in
config_settings.h. For example "backup_archive_dir_CFG" if defined
as a setting with default value evaluated in runtime with "cfg_runtime"
will automatically have "get_default_backup_archive_dir_CFG" function
linked to this setting to get the default value.

10 years agoconfig: use mempool for config paths used in find_config_tree_* functions
Peter Rajnoha [Mon, 3 Mar 2014 11:29:25 +0000 (12:29 +0100)]
config: use mempool for config paths used in find_config_tree_* functions

Using mempool is much safer than using the global static variable.
The global variable would be rewritten on each find_config_tree_* call
and we need to be very careful not to get into this problem (we don't
do now, but we can with the patches for "runtime defaults" that will follow).

10 years agoconfig: fixup default values for selected config settings
Peter Rajnoha [Thu, 6 Mar 2014 08:41:11 +0000 (09:41 +0100)]
config: fixup default values for selected config settings

These settings don't have any default value predefined:
  log/file
  log/activate_file
  global/library_dir

This settings has default value but not yet declared in config_settings.h:
  global/locking_library (default is DEFAULT_LOCKING_LIB)

10 years agocmirrord: Clean-up stray warning message
Jonathan Brassow [Wed, 5 Mar 2014 16:44:20 +0000 (10:44 -0600)]
cmirrord:  Clean-up stray warning message

cmirrord polls for messages on the kernel and cluster interfaces.
Sometimes it is possible for messages to be received on the cluster
interface and be waiting for processing while the node is in the
process of leaving the cluster group.  When this happens, the
messages received on the cluster interface are attempted to be
dispatched, but an error is returned because the connection is no
longer valid.  It is a harmless situation.  So, if we get the
specific error (CS_ERR_BAD_HANDLE) and we know that we have left
the group, then simply don't print the message.

10 years agoudev: run pvscan --cache via systemd-run in udev if the PV label is detected lost
Peter Rajnoha [Wed, 5 Mar 2014 13:25:08 +0000 (14:25 +0100)]
udev: run pvscan --cache via systemd-run in udev if the PV label is detected lost

If the PV label is lost (e.g. by doing a dd on the device), call
"systemd-run pvscan --cache <major>:<minor>" in 69-dm-lvm-metad.rules
to inform lvmetad about this state.

The reason for this is that ENV{SYSTEMD_WANTS}="lvm2-pvscan@<major>:<minor>"
logic will not cause the pvscan to be fired in this case since this works
only on proper device addition/removal cycle - the lvm2-pvscan service's
ExecStop is called only on proper REMOVE event - the service is bound to
device existence. Hence we need pvscan call via systemd-run (that
instantiates a quick transient service just to call the command).

See also https://bugzilla.redhat.com/show_bug.cgi?id=1063813.

10 years agotest: Use correct path to /dev in lvchange-raid.sh.
Petr Rockai [Wed, 5 Mar 2014 09:21:49 +0000 (10:21 +0100)]
test: Use correct path to /dev in lvchange-raid.sh.

10 years agotests: testing usable of /dev/kmsg
Zdenek Kabelac [Tue, 4 Mar 2014 16:50:17 +0000 (17:50 +0100)]
tests: testing usable of /dev/kmsg

It's not so easy to recongnize unusable /dev/kmsg
Reorder the code in a way if the first regular read of /dev/kmsg
fail, fallback to klogctl interface.

Call drain_dmesg also for the case there is no user log output.

10 years agotests: hide error message
Zdenek Kabelac [Tue, 4 Mar 2014 15:41:07 +0000 (16:41 +0100)]
tests: hide error message

Make the logging looks normal for this case

10 years agotests: print kernel version
Zdenek Kabelac [Tue, 4 Mar 2014 15:24:44 +0000 (16:24 +0100)]
tests: print kernel version

10 years agotests: check readability of /dev/kmsg
Zdenek Kabelac [Tue, 4 Mar 2014 15:22:11 +0000 (16:22 +0100)]
tests: check readability of /dev/kmsg

Looks like there are systems with /dev/kmsg device,
which is however not readable

Fix check for result value of klogctl and use only positive value.

10 years agotests: reinstantiate support for klogctl
Zdenek Kabelac [Tue, 4 Mar 2014 14:10:58 +0000 (15:10 +0100)]
tests: reinstantiate support for klogctl

Add a bit more complexity here - Switch to use /dev/kmsg
which has been introduced in 3.5 kernels and could run without
lossing lines from /proc/kmsg.

On older systems user may set env var LVM_TEST_CAN_CLOBBER_DMESG=1
to get kernel messages via klogctl() call (which deletes dmesg buffer)
otherwise no logging of kernel messages is provided.

10 years agotest: Make teardown (more) resistant to funny DM device names.
Petr Rockai [Mon, 3 Mar 2014 22:01:40 +0000 (23:01 +0100)]
test: Make teardown (more) resistant to funny DM device names.

10 years agotests: restore .txt suffix
Zdenek Kabelac [Mon, 3 Mar 2014 18:01:30 +0000 (19:01 +0100)]
tests: restore .txt suffix

10 years agotests: speedup kmsg processing
Zdenek Kabelac [Mon, 3 Mar 2014 18:08:22 +0000 (19:08 +0100)]
tests: speedup kmsg processing

Since there could be multiple readers of kmsg (test & journald) it needs
to be fast, to capture things like sysrq trace.

But to capture whole output it would need to prioritize reading of kmsg,
thus we would first log kernel messages and followed by command output.

As a trade-off always log command output first and use large drain
buffer so is captures most of messages, but occasionaly miss some
lines.

10 years agotests: split raid test
Zdenek Kabelac [Mon, 3 Mar 2014 10:20:40 +0000 (11:20 +0100)]
tests: split raid test

Use separate files for raid1, raid456, raid10.
They need different target versions to work, so support
more precise test selection.

Optimize duplicate tests of target avalability and skip
unsupported test cases sooner.

10 years agolvmetad: fix minor gcc warning
Zdenek Kabelac [Sun, 2 Mar 2014 21:26:21 +0000 (22:26 +0100)]
lvmetad: fix minor gcc warning

Cast to pass in non-const pointer

10 years agotest: Remove incorrect evaluation
Marian Csontos [Mon, 3 Mar 2014 07:31:33 +0000 (08:31 +0100)]
test: Remove incorrect evaluation

10 years agotests: detect nc or socat
Zdenek Kabelac [Sun, 2 Mar 2014 20:48:28 +0000 (21:48 +0100)]
tests: detect nc or socat

Since shell is not in -o pipefail mode here,
we need to generate separate failure ahead of tee.

10 years agotests: restore usage of reading kmsg
Zdenek Kabelac [Sun, 2 Mar 2014 20:30:26 +0000 (21:30 +0100)]
tests: restore usage of reading kmsg

Basically reverts commit af8580d756d3d4ed56a00d377fd6bfb18d5bed41.
"test: Use klogctl in the harness instead of reading /var/log/messages."

Problem is - this interface clears dmesg buffer
(just like call of dmesg -c)
Thus after running lvm2 test suitedmesg is empty - while all the
messages are usually logged in the journal/message, it's still not nice to
clear dmesg buffer.

It's not a pure revert, but switch to use /proc/kmsg directly instead of
reading /var/log/messages.

10 years agotests: split raid test
Zdenek Kabelac [Sun, 2 Mar 2014 18:46:17 +0000 (19:46 +0100)]
tests: split raid test

Use separate test file for raid456
Change test for broken kernel which has broken raid456 support.

10 years agotests: disable test which leaks node
Zdenek Kabelac [Sun, 2 Mar 2014 18:16:48 +0000 (19:16 +0100)]
tests: disable test which leaks node

This test is not detected as fault but leak device node
on a real /dev.
Added FIXME.

10 years agotests: report selinux mode
Zdenek Kabelac [Sun, 2 Mar 2014 18:15:52 +0000 (19:15 +0100)]
tests: report selinux mode

10 years agotests: use longer sleep
Zdenek Kabelac [Sun, 2 Mar 2014 18:08:02 +0000 (19:08 +0100)]
tests: use longer sleep

Eplore why 30sec is not enough for hydra and try higher value.

10 years agotest: Test that we cope with stray device nodes.
Petr Rockai [Sun, 2 Mar 2014 19:45:37 +0000 (20:45 +0100)]
test: Test that we cope with stray device nodes.

10 years agotest: Properly synchronize direct dmsetup calls.
Petr Rockai [Sun, 2 Mar 2014 19:11:44 +0000 (20:11 +0100)]
test: Properly synchronize direct dmsetup calls.

10 years agotests: detect reiserfs support
Zdenek Kabelac [Fri, 28 Feb 2014 22:05:58 +0000 (23:05 +0100)]
tests: detect reiserfs support

Since reiserfs is not commonly available detect its presence in kernel.
Stop reporting skipped test as WARNING.

10 years agolvmetad: more reuse precommit buffer
Zdenek Kabelac [Fri, 28 Feb 2014 21:40:00 +0000 (22:40 +0100)]
lvmetad: more reuse precommit buffer

This patch moves more allocation to vg_write
(as started in 8c878438f5a75310d09a1ee035d9caf8e2b9e50b)
TODO: relocate also communication.
(in-release update)

10 years agolvmetad: move memalloc/free out of lock
Zdenek Kabelac [Sat, 1 Mar 2014 10:38:41 +0000 (11:38 +0100)]
lvmetad: move memalloc/free out of lock

Small code move to lower locking time and make memory
allocation and free outside of lock.

Drop duplicate test of NULL pointer before calling dm_free.

10 years agolvmetad: fix memleak when pv changes it device
Zdenek Kabelac [Sat, 1 Mar 2014 10:36:05 +0000 (11:36 +0100)]
lvmetad: fix memleak when pv changes it device

Test vgimportclone invokes mem leak of pvid which
would be otherwise lost when device_old_pvid
is removed from hash table.

10 years agolvmetad: Fix an invalid memory read that could cause a deadlock.
Petr Rockai [Fri, 28 Feb 2014 23:42:09 +0000 (00:42 +0100)]
lvmetad: Fix an invalid memory read that could cause a deadlock.

10 years agoNIX: Cope with existence of multiple primary.xml files.
Petr Rockai [Fri, 28 Feb 2014 22:56:04 +0000 (23:56 +0100)]
NIX: Cope with existence of multiple primary.xml files.

This can happen temporarily while a mirror is syncing (parsing repomd.xml
would be a better fix, but slightly tricky since it's xml).

10 years agotest: Fix stat calls in lvmetad-pvscan-filter.
Petr Rockai [Fri, 28 Feb 2014 22:33:30 +0000 (23:33 +0100)]
test: Fix stat calls in lvmetad-pvscan-filter.

10 years agotest: Downgrade lvmetad-lvm1 failure to a warning.
Petr Rockai [Fri, 28 Feb 2014 22:33:17 +0000 (23:33 +0100)]
test: Downgrade lvmetad-lvm1 failure to a warning.

10 years agotest: Fix the failing branch in aux lvmetad_talk.
Petr Rockai [Fri, 28 Feb 2014 22:30:17 +0000 (23:30 +0100)]
test: Fix the failing branch in aux lvmetad_talk.

10 years agoformat-text: Fix a warning.
Petr Rockai [Fri, 28 Feb 2014 15:23:16 +0000 (16:23 +0100)]
format-text: Fix a warning.

10 years agoformat-text: Fix _raw_read_mda_header (missing close, open r/o).
Petr Rockai [Fri, 28 Feb 2014 15:21:09 +0000 (16:21 +0100)]
format-text: Fix _raw_read_mda_header (missing close, open r/o).

10 years agospec: udev rules don't live under %{_prefix} on fc16/rhel6
Petr Rockai [Fri, 28 Feb 2014 13:18:15 +0000 (14:18 +0100)]
spec: udev rules don't live under %{_prefix} on fc16/rhel6

10 years agotest: Add lvmetad_talk and lvmetad_dump to aux.
Petr Rockai [Fri, 28 Feb 2014 10:18:33 +0000 (11:18 +0100)]
test: Add lvmetad_talk and lvmetad_dump to aux.

10 years agotest: Fix notify_lvmetad for symlinked devices.
Petr Rockai [Fri, 28 Feb 2014 10:07:56 +0000 (11:07 +0100)]
test: Fix notify_lvmetad for symlinked devices.

10 years agolvmetad: Keep the cache consistent when a PV moves around.
Petr Rockai [Fri, 28 Feb 2014 09:59:12 +0000 (10:59 +0100)]
lvmetad: Keep the cache consistent when a PV moves around.

In cases where PV appears on a new device without disappearing from an old one
first, the device->pvid pointers could become ambiguous. This could cause the
ambiguous PV to be lost from the cache when a different PV comes up on one of
the ambiguous devices.

10 years agolvmetad: Hide corrupt MDAs from the cache.
Petr Rockai [Thu, 27 Feb 2014 22:06:42 +0000 (23:06 +0100)]
lvmetad: Hide corrupt MDAs from the cache.

This is probably not optimal, but makes the lvmetad case mimic non-lvmetad code
more closely. It also fixes vgremove of a partially corrupt VG with lvmetad, as
_vg_write_raw (and consequently, entire vg_write) currently panics when it
encounters a corrupt MDA. Ideally, we'd be able to explicitly control when it is
safe to ignore them.

10 years agoNIX: Change the URL for the lcov RPM to a more canonic location.
Petr Rockai [Thu, 27 Feb 2014 22:43:57 +0000 (23:43 +0100)]
NIX: Change the URL for the lcov RPM to a more canonic location.

10 years agoNIX: Update the release.nix path in build.sh.
Petr Rockai [Thu, 27 Feb 2014 22:43:29 +0000 (23:43 +0100)]
NIX: Update the release.nix path in build.sh.

10 years agoNIX: Add a short README (to be expanded).
Petr Rockai [Thu, 27 Feb 2014 22:36:49 +0000 (23:36 +0100)]
NIX: Add a short README (to be expanded).

10 years agospec: Add a copyright header and an explanatory notice.
Petr Rockai [Thu, 27 Feb 2014 22:22:33 +0000 (23:22 +0100)]
spec: Add a copyright header and an explanatory notice.

10 years agoNIX: Move nix-related bits under nix/.
Petr Rockai [Thu, 27 Feb 2014 22:15:28 +0000 (23:15 +0100)]
NIX: Move nix-related bits under nix/.

10 years agospec: Package the new clvmd/cmirrord systemd units.
Petr Rockai [Thu, 20 Feb 2014 08:49:45 +0000 (09:49 +0100)]
spec: Package the new clvmd/cmirrord systemd units.

10 years agoNIX: On RHEL<=6 and FC<=16, udevd is /sbin/udevd.
Petr Rockai [Thu, 23 Jan 2014 21:12:00 +0000 (22:12 +0100)]
NIX: On RHEL<=6 and FC<=16, udevd is /sbin/udevd.

10 years agoNIX: Add a local nix-build.sh script.
Petr Rockai [Thu, 23 Jan 2014 15:42:54 +0000 (16:42 +0100)]
NIX: Add a local nix-build.sh script.

10 years agoNIX: Add CentOS 6.5 builds.
Petr Rockai [Wed, 8 Jan 2014 15:35:55 +0000 (16:35 +0100)]
NIX: Add CentOS 6.5 builds.

10 years agoNIX: Retire the CentOS 6.3 builds.
Petr Rockai [Wed, 8 Jan 2014 15:35:39 +0000 (16:35 +0100)]
NIX: Retire the CentOS 6.3 builds.

10 years agoNIX: Use vault.centos.org to get older revisions.
Petr Rockai [Wed, 8 Jan 2014 14:35:12 +0000 (15:35 +0100)]
NIX: Use vault.centos.org to get older revisions.

10 years agospec: We do want thin support on RHEL 6.
Petr Rockai [Tue, 17 Dec 2013 14:23:08 +0000 (15:23 +0100)]
spec: We do want thin support on RHEL 6.

10 years agospec: Do not treat --with-?=none as having the thing.
Petr Rockai [Tue, 17 Dec 2013 09:14:28 +0000 (10:14 +0100)]
spec: Do not treat --with-?=none as having the thing.

10 years agospec: Explicitly disable thin when we don't want it.
Petr Rockai [Mon, 16 Dec 2013 15:23:34 +0000 (16:23 +0100)]
spec: Explicitly disable thin when we don't want it.

10 years agoNIX: Run system-wide tests separately, with RPMs installed.
Petr Rockai [Sun, 15 Dec 2013 20:14:30 +0000 (21:14 +0100)]
NIX: Run system-wide tests separately, with RPMs installed.

10 years agospec: Make it possible for %check_commands to prevent %clean-ing.
Petr Rockai [Sun, 15 Dec 2013 20:12:06 +0000 (21:12 +0100)]
spec: Make it possible for %check_commands to prevent %clean-ing.

10 years agoNIX: Revert to calling make check inside the RPM build.
Petr Rockai [Sun, 15 Dec 2013 16:29:08 +0000 (17:29 +0100)]
NIX: Revert to calling make check inside the RPM build.

10 years agospec: Add lvm2-pvscan@.service to filelist.
Petr Rockai [Tue, 19 Nov 2013 08:24:17 +0000 (09:24 +0100)]
spec: Add lvm2-pvscan@.service to filelist.

10 years agospec: Add thin-performance.profile to the filelist.
Petr Rockai [Sun, 17 Nov 2013 17:20:53 +0000 (18:20 +0100)]
spec: Add thin-performance.profile to the filelist.

10 years agoNIX: Update URL for lcov RPM.
Petr Rockai [Fri, 15 Nov 2013 21:11:17 +0000 (22:11 +0100)]
NIX: Update URL for lcov RPM.

10 years agoNIX: Skip autoconf, as we include ./configure in git.
Petr Rockai [Fri, 15 Nov 2013 18:11:15 +0000 (19:11 +0100)]
NIX: Skip autoconf, as we include ./configure in git.

10 years agoNIX: Try harder to set dmesg levels.
Petr Rockai [Tue, 3 Sep 2013 13:48:34 +0000 (15:48 +0200)]
NIX: Try harder to set dmesg levels.

10 years agoNIX: Give the VMs more RAM (768M instead of 512M).
Petr Rockai [Sat, 31 Aug 2013 08:01:13 +0000 (10:01 +0200)]
NIX: Give the VMs more RAM (768M instead of 512M).

10 years agoNIX: Fix a centos64 failure due to old dmesg.
Petr Rockai [Fri, 30 Aug 2013 23:25:26 +0000 (01:25 +0200)]
NIX: Fix a centos64 failure due to old dmesg.

10 years agoNIX: Do not insmod 9p/virtfs on centos64 as it BUGs out right away.
Petr Rockai [Fri, 30 Aug 2013 23:00:19 +0000 (01:00 +0200)]
NIX: Do not insmod 9p/virtfs on centos64 as it BUGs out right away.

10 years agoNIX: Restore CIFS modules, as 9p is broken on many kernels.
Petr Rockai [Fri, 30 Aug 2013 22:35:11 +0000 (00:35 +0200)]
NIX: Restore CIFS modules, as 9p is broken on many kernels.

10 years agoNIX: Add %with thin_dump to the specfile.
Petr Rockai [Fri, 30 Aug 2013 16:30:20 +0000 (18:30 +0200)]
NIX: Add %with thin_dump to the specfile.

10 years agoNIX: Add %with thin_repair to the specfile.
Petr Rockai [Fri, 30 Aug 2013 16:24:25 +0000 (18:24 +0200)]
NIX: Add %with thin_repair to the specfile.

10 years agoNIX: Fedora 19 is now stable. Add builds that include updates.
Petr Rockai [Tue, 27 Aug 2013 00:10:58 +0000 (02:10 +0200)]
NIX: Fedora 19 is now stable. Add builds that include updates.

10 years agoNIX: Use the new "check_full" target for comprehensive testing.
Petr Rockai [Fri, 23 Aug 2013 08:14:41 +0000 (10:14 +0200)]
NIX: Use the new "check_full" target for comprehensive testing.

10 years agonix: Look a bit harder for udevd.
Petr Rockai [Tue, 20 Aug 2013 21:04:37 +0000 (23:04 +0200)]
nix: Look a bit harder for udevd.

10 years agonix: Set kernel console log level to debug.
Petr Rockai [Tue, 20 Aug 2013 15:34:12 +0000 (17:34 +0200)]
nix: Set kernel console log level to debug.

10 years agonix: Run udevd in foreground.
Petr Rockai [Tue, 20 Aug 2013 15:33:38 +0000 (17:33 +0200)]
nix: Run udevd in foreground.

10 years agoNIX: Run tests with /dev and (on recent Fedora) with udevd running.
Petr Rockai [Mon, 5 Aug 2013 19:16:54 +0000 (21:16 +0200)]
NIX: Run tests with /dev and (on recent Fedora) with udevd running.

10 years agoNIX: Fix chrooted builds, passing down package lists explicitly.
Petr Rockai [Tue, 23 Jul 2013 09:02:22 +0000 (11:02 +0200)]
NIX: Fix chrooted builds, passing down package lists explicitly.

10 years agoNIX: The mergeUsr attribute was renamed to unifiedSystemDir.
Petr Rockai [Mon, 22 Jul 2013 22:26:33 +0000 (00:26 +0200)]
NIX: The mergeUsr attribute was renamed to unifiedSystemDir.

10 years agoNIX: Add default.profile to the spec file.
Petr Rockai [Mon, 22 Jul 2013 21:38:02 +0000 (23:38 +0200)]
NIX: Add default.profile to the spec file.

10 years agoNIX: Add an fc18 build that includes fedora updates.
Petr Rockai [Mon, 22 Jul 2013 21:37:17 +0000 (23:37 +0200)]
NIX: Add an fc18 build that includes fedora updates.

10 years agoNIX: Adapt to use of 9P in VM builds.
Petr Rockai [Mon, 22 Jul 2013 11:32:43 +0000 (13:32 +0200)]
NIX: Adapt to use of 9P in VM builds.

10 years agoNIX: Make it possible to only run a subset of tests (via T).
Petr Rockai [Mon, 27 May 2013 03:57:32 +0000 (05:57 +0200)]
NIX: Make it possible to only run a subset of tests (via T).

10 years agoNIX: Fix a couple typos in build product handling.
Petr Rockai [Mon, 27 May 2013 03:57:01 +0000 (05:57 +0200)]
NIX: Fix a couple typos in build product handling.

10 years agoNIX: Copy collected test results into the output.
Petr Rockai [Mon, 27 May 2013 02:27:26 +0000 (04:27 +0200)]
NIX: Copy collected test results into the output.

10 years agoNIX: Grab specfile from lvm2Nix (at least for now).
Petr Rockai [Sun, 26 May 2013 16:13:25 +0000 (18:13 +0200)]
NIX: Grab specfile from lvm2Nix (at least for now).

10 years agoNIX: Fix build-dependencies for FC 18.
Petr Rockai [Sun, 26 May 2013 14:26:04 +0000 (16:26 +0200)]
NIX: Fix build-dependencies for FC 18.

10 years agonix: Import the modular specfile we use for nix-driven builds.
Petr Rockai [Wed, 8 May 2013 10:33:11 +0000 (12:33 +0200)]
nix: Import the modular specfile we use for nix-driven builds.

10 years agotest: warn rather than fail when %FREE isn't working right
Jonathan Brassow [Fri, 28 Feb 2014 04:44:57 +0000 (22:44 -0600)]
test: warn rather than fail when %FREE isn't working right

%FREE allocation has been broken for RAID.  At 100%FREE, there is
still an extent left for certain tests.  For now, change the test
to warn rather than completely fail.

10 years agotests: remove extra vgremove
Zdenek Kabelac [Thu, 27 Feb 2014 13:53:33 +0000 (14:53 +0100)]
tests: remove extra vgremove

These vgremove calls were not correct.

10 years agotests: quote dev
Zdenek Kabelac [Thu, 27 Feb 2014 13:49:49 +0000 (14:49 +0100)]
tests: quote dev

10 years agotests: drop remove
Zdenek Kabelac [Thu, 27 Feb 2014 13:48:32 +0000 (14:48 +0100)]
tests: drop remove

Generates waaaaay too much log from lvmetad test.

TODO: once we will be able to remove more LVs with a single
write - we may restore....

10 years agocleanup: relocate segment flags
Zdenek Kabelac [Thu, 27 Feb 2014 13:46:11 +0000 (14:46 +0100)]
cleanup: relocate segment flags

Move flags for segments to segtype header where it seems more closely
related as the features are related to segtype and not activation.

Use unsigned #define - since it's more common in lvm2 source code
for bit flags.

10 years agotests: updates
Zdenek Kabelac [Wed, 26 Feb 2014 22:25:30 +0000 (23:25 +0100)]
tests: updates

Add some vgremove calls.
Remove uneeded test for some unused commands.
Add tests for missing commands.

10 years agosnapshot: correct previous snapshot commit
Zdenek Kabelac [Thu, 27 Feb 2014 11:55:50 +0000 (12:55 +0100)]
snapshot: correct previous snapshot commit

Condition was swapped - however since it's been based on 'random'
memory content it's been missed as attribute has not been set.

So now we have quite a few possible results when testing.

We have old status without separate metadata and
we have kernels with fixed snapshot leak bug.

(in-release update)

10 years agolvmetad: Make token_mismatch handling more robust in the clients.
Petr Rockai [Wed, 26 Feb 2014 14:11:00 +0000 (15:11 +0100)]
lvmetad: Make token_mismatch handling more robust in the clients.

10 years agolvmetad: Make "reason" in a token_mismatch reply more informative.
Petr Rockai [Wed, 26 Feb 2014 14:10:21 +0000 (15:10 +0100)]
lvmetad: Make "reason" in a token_mismatch reply more informative.

10 years agosnapshots: fix incorrect calculation of cow size
Zdenek Kabelac [Tue, 25 Feb 2014 18:43:07 +0000 (19:43 +0100)]
snapshots: fix incorrect calculation of cow size

Code uses target driver version for better estimation of
max size of COW device for snapshot.

The bug can be tested with this script:
VG=vg1
lvremove -f $VG/origin
set -e
lvcreate -L 2143289344b -n origin $VG
lvcreate -n snap -c 8k -L 2304M -s $VG/origin
dd if=/dev/zero of=/dev/$VG/snap bs=1M count=2044 oflag=direct

The bug happens when these two conditions are met
* origin size is divisible by (chunk_size/16) - so that the last
  metadata area is filled completely
* the miscalculated snapshot metadata size is divisible by extent size -
  so that there is no padding to extent boundary which would otherwise
  save us

Signed-off-by:Mikulas Patocka <mpatocka@redhat.com>

10 years agolvresize: fix stripe size validation
Zhiqing Zhang [Wed, 26 Feb 2014 02:14:18 +0000 (10:14 +0800)]
lvresize: fix stripe size validation

While stripe size is twice the physical extent size,
the original code will not reduce stripe size to maximum
(physical extent size).

Signed-off-by: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
10 years agotests: support for older snapshot target version
Zdenek Kabelac [Wed, 26 Feb 2014 10:16:08 +0000 (11:16 +0100)]
tests: support for older snapshot target version

TODO: unsure about 1.10...

10 years agotests: improve read-only test for snapshot
Zdenek Kabelac [Wed, 26 Feb 2014 09:19:46 +0000 (10:19 +0100)]
tests: improve read-only test for snapshot

Switch to use ext2 to make it usable on older systems.
Previous test has not been able to catching problem.

Multiple tests are now put in.

FIXME: validate what is doing kernel target when
the header is undeleted and same chunk size is used.

It seems snapshot target successfully resumes and
just complains COW is not big enough:

kernel: dm-8: rw=0, want=40, limit=24
kernel: attempt to access beyond end of device

When chunk size is different it fails instantly.

For checking this with lvm2 and this test case use this patch:

--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -769,7 +769,7 @@ static int _read_activation_params(struct
lvcreate_params *lp,
        lp->permission = arg_uint_value(cmd, permission_ARG,
                                        LVM_READ | LVM_WRITE);

-       if (lp->snapshot) {
+       if (0 && lp->snapshot) {
                /* Snapshot has to zero COW header */
                lp->zero = 1;
                lp->wipe_signatures = 0;

---
and switch to use  -c 4 for both snapshots

10 years agosnapshot: zero cow header for read-only snapshot
Zdenek Kabelac [Tue, 25 Feb 2014 23:17:11 +0000 (00:17 +0100)]
snapshot: zero cow header for read-only snapshot

When read-only snapshot was created, tool was skipping header
initialization of cow device.  If it happened device has been
already containing header from some previous snapshot, it's
been 'reused' for a newly created snapshot instead of being cleared.

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