v2_02_152 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b2492903a60097...
Commit: b2492903a600973fe9110285804b1c02b71d284c
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-04-30 00:09 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-04-30 00:09 +0000
annotated tag: v2_02_152 has been created
at b2492903a600973fe9110285804b1c02b71d284c (tag)
tagging e53ecf91f7550b77d8b85545e49c5805332ddd8d (commit)
replaces v2_02_151
Release 2.02.152.
More bug fixes.
23 files changed, 321 insertions(+), 116 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlcj9+QACgkQIoGRwVZ+LBe4iwCgiXA8V0KTpjBFmt7zjZxN7Nm/
ogwAoLNwaDOf6yBE1nG0KNmrSnfGCqIi
=Yxmh
-----END PGP SIGNATURE-----
Alasdair G Kergon (5):
post-release
libdm: Add dm_udev_wait_immediate.
datastruct: Add str_list_wipe.
raid: Use inherited tags when wiping rmeta.
pre-release
David Teigland (3):
metadata: fix segfault when filters reject devices
lvmetad: improve warning after lvmetad message fails
pvscan: autoactivation should ignore some VGs
Peter Rajnoha (4):
metadata: log warning instead of error if device not found while checking used and assumed devs
cleanup: do not mention segment in warning message if device not found for a PV when checking used/assumed devs for an LV
udev: rules: remove mpath from 10-dm.rules, superseded by 11-dm-mpath.rules (mpath>=0.6.0)
udev: rules: add comments explaining subsystem-specific rules
Zdenek Kabelac (12):
modprobe: check /sys/module entry first
cache: with cache target 1.9 mq is alias to smq
cache: check for clean cache as separete function
thin: zero and transaction_id also with thin volumes
lvchange: fix return code
lvchange: always check for sigint
lvchange: use better arg functions
man: lvchange updates
man: lvcreate doc passthrough
cleanup: smaller timeout
cleanup: use log_debug_activation
cache: better support for alias check
7 years, 4 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=795e47cec572b1...
Commit: 795e47cec572b13329eecbcfbbc0aa70f0bccc16
Parent: e53ecf91f7550b77d8b85545e49c5805332ddd8d
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Apr 30 01:12:33 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Apr 30 01:12:33 2016 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index e3d1fb7..680848d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.152(2)-git (2016-04-30)
+2.02.153(2)-git (2016-04-30)
diff --git a/VERSION_DM b/VERSION_DM
index dc7dbb4..1eb63a8 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.124-git (2016-04-30)
+1.02.125-git (2016-04-30)
diff --git a/WHATS_NEW b/WHATS_NEW
index c6fe1db..7291482 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.153 -
+==================================
+
Version 2.02.152 - 30th April 2016
==================================
Use any inherited tags when wiping metadata sub LVs to ensure activation.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 24561d4..f6392ef 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.125 -
+==================================
+
Version 1.02.124 - 30th April 2016
==================================
Add dm_udev_wait_immediate to libdevmapper for waiting outside the library.
7 years, 4 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e53ecf91f7550b...
Commit: e53ecf91f7550b77d8b85545e49c5805332ddd8d
Parent: c76df666c903b59f069292c4c1507b1ac37a5590
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Apr 30 01:07:26 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Apr 30 01:07:26 2016 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 2 +-
WHATS_NEW_DM | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/VERSION b/VERSION
index a9bd406..e3d1fb7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.152(2)-git (2016-04-23)
+2.02.152(2)-git (2016-04-30)
diff --git a/VERSION_DM b/VERSION_DM
index da7e631..dc7dbb4 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.124-git (2016-04-23)
+1.02.124-git (2016-04-30)
diff --git a/WHATS_NEW b/WHATS_NEW
index a712c5f..c6fe1db 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,4 +1,4 @@
-Version 2.02.152 -
+Version 2.02.152 - 30th April 2016
==================================
Use any inherited tags when wiping metadata sub LVs to ensure activation.
Add str_list_wipe.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index b21d7d5..24561d4 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,4 +1,4 @@
-Version 1.02.124 -
+Version 1.02.124 - 30th April 2016
==================================
Add dm_udev_wait_immediate to libdevmapper for waiting outside the library.
7 years, 4 months
master - raid: Use inherited tags when wiping rmeta.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c76df666c903b5...
Commit: c76df666c903b59f069292c4c1507b1ac37a5590
Parent: e3efcdc9f5d98807ff9887aa602aff1bdc870cbd
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Apr 29 19:49:21 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Apr 29 19:49:21 2016 +0100
raid: Use inherited tags when wiping rmeta.
If there's an activation volume_filter, it might not be possible
to activate the rmeta LVs to wipe them. At least inherit any
LV tags from the parent LV while attempting this.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 55ecb68..a712c5f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.152 -
==================================
+ Use any inherited tags when wiping metadata sub LVs to ensure activation.
Add str_list_wipe.
Improve support for interrupting procesing of volumes during lvchange.
Use failed command return code when lvchanging read-only volume.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 4bce808..cd0a78c 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3834,6 +3834,16 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
return 0;
}
lv_set_visible(meta_lv);
+
+ /*
+ * Copy any tags from the new LV to the metadata LV so
+ * it can be activated temporarily.
+ */
+ if (!str_list_dup(meta_lv->vg->vgmem, &meta_lv->tags, &lv->tags)) {
+ log_error("Failed to copy tags onto LV %s to clear metadata.", display_lvname(meta_lv));
+ return 0;
+ }
+
clear_metadata = 1;
}
@@ -3882,6 +3892,9 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
return 0;
}
lv_set_hidden(meta_lv);
+
+ /* Wipe any temporary tags required for activation. */
+ str_list_wipe(&meta_lv->tags);
}
}
7 years, 4 months
master - datastruct: Add str_list_wipe.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e3efcdc9f5d988...
Commit: e3efcdc9f5d98807ff9887aa602aff1bdc870cbd
Parent: 16019b518e287da19c87eb64229f5c3ca057cb05
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Apr 29 19:47:15 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Apr 29 19:47:15 2016 +0100
datastruct: Add str_list_wipe.
---
WHATS_NEW | 1 +
lib/datastruct/str_list.c | 18 +++++++++++++-----
lib/datastruct/str_list.h | 1 +
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3f036e1..55ecb68 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.152 -
==================================
+ Add str_list_wipe.
Improve support for interrupting procesing of volumes during lvchange.
Use failed command return code when lvchanging read-only volume.
Show creation transaction_id and zeroing state of pool with thin volume.
diff --git a/lib/datastruct/str_list.c b/lib/datastruct/str_list.c
index 3dfc6d7..6fe5672 100644
--- a/lib/datastruct/str_list.c
+++ b/lib/datastruct/str_list.c
@@ -92,7 +92,15 @@ void str_list_del(struct dm_list *sll, const char *str)
dm_list_iterate_safe(slh, slht, sll)
if (!strcmp(str, dm_list_item(slh, struct dm_str_list)->str))
- dm_list_del(slh);
+ dm_list_del(slh);
+}
+
+void str_list_wipe(struct dm_list *sll)
+{
+ struct dm_list *slh, *slht;
+
+ dm_list_iterate_safe(slh, slht, sll)
+ dm_list_del(slh);
}
int str_list_dup(struct dm_pool *mem, struct dm_list *sllnew,
@@ -118,8 +126,8 @@ int str_list_match_item(const struct dm_list *sll, const char *str)
struct dm_str_list *sl;
dm_list_iterate_items(sl, sll)
- if (!strcmp(str, sl->str))
- return 1;
+ if (!strcmp(str, sl->str))
+ return 1;
return 0;
}
@@ -153,8 +161,8 @@ int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2)
return 0;
dm_list_iterate_items(sl, sll)
- if (!str_list_match_item(sll2, sl->str))
- return 0;
+ if (!str_list_match_item(sll2, sl->str))
+ return 0;
return 1;
}
diff --git a/lib/datastruct/str_list.h b/lib/datastruct/str_list.h
index 82807f3..9f6d331 100644
--- a/lib/datastruct/str_list.h
+++ b/lib/datastruct/str_list.h
@@ -25,6 +25,7 @@ int str_list_add_list(struct dm_pool *mem, struct dm_list *sll, struct dm_list *
int str_list_add_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
int str_list_add_h_no_dup_check(struct dm_pool *mem, struct dm_list *sll, const char *str);
void str_list_del(struct dm_list *sll, const char *str);
+void str_list_wipe(struct dm_list *sll);
int str_list_match_item(const struct dm_list *sll, const char *str);
int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2, const char **tag_matched);
int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2);
7 years, 4 months
master - libdm: Add dm_udev_wait_immediate.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=16019b518e287d...
Commit: 16019b518e287da19c87eb64229f5c3ca057cb05
Parent: a2d2a61339b83de0d48ed6ed15e816773393c6b4
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Apr 28 00:54:27 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Apr 28 00:54:27 2016 +0100
libdm: Add dm_udev_wait_immediate.
dm_udev_wait() waits inside the library.
dm_udev_wait_immediate allows the caller to do other things if the
cookie isn't yet ready to be decremented.
---
WHATS_NEW_DM | 1 +
libdm/.exported_symbols.DM_1_02_124 | 1 +
libdm/libdevmapper.h | 9 ++++++
libdm/libdm-common.c | 49 +++++++++++++++++++++++++++++++++-
4 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 7460a94..b21d7d5 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.124 -
==================================
+ Add dm_udev_wait_immediate to libdevmapper for waiting outside the library.
Version 1.02.123 - 23rd April 2016
==================================
diff --git a/libdm/.exported_symbols.DM_1_02_124 b/libdm/.exported_symbols.DM_1_02_124
new file mode 100644
index 0000000..934011a
--- /dev/null
+++ b/libdm/.exported_symbols.DM_1_02_124
@@ -0,0 +1 @@
+dm_udev_wait_immediate
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index a90013f..d2f40c9 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -3218,6 +3218,15 @@ int dm_udev_create_cookie(uint32_t *cookie);
int dm_udev_complete(uint32_t cookie);
int dm_udev_wait(uint32_t cookie);
+/*
+ * dm_dev_wait_immediate
+ * If *ready is 1 on return, the wait is complete.
+ * If *ready is 0 on return, the wait is incomplete and either
+ * this function or dm_udev_wait() must be called again.
+ * Returns 0 on error, when neither function should be called again.
+ */
+int dm_udev_wait_immediate(uint32_t cookie, int *ready);
+
#define DM_DEV_DIR_UMASK 0022
#define DM_CONTROL_NODE_UMASK 0177
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 2580d94..d67d0bb 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -2082,6 +2082,14 @@ int dm_udev_wait(uint32_t cookie)
return 1;
}
+int dm_udev_wait_immediate(uint32_t cookie, int *ready)
+{
+ update_devs();
+ *ready = 1;
+
+ return 1;
+}
+
#else /* UDEV_SYNC_SUPPORT */
static int _check_semaphore_is_supported(void)
@@ -2506,10 +2514,16 @@ int dm_udev_complete(uint32_t cookie)
return 1;
}
-static int _udev_wait(uint32_t cookie)
+/*
+ * If *nowait is set, return immediately leaving it set if the semaphore
+ * is not ready to be decremented to 0. *nowait is cleared if the wait
+ * succeeds.
+ */
+static int _udev_wait(uint32_t cookie, int *nowait)
{
int semid;
struct sembuf sb = {0, 0, 0};
+ int val;
if (!cookie || !dm_udev_get_sync_support())
return 1;
@@ -2517,6 +2531,21 @@ static int _udev_wait(uint32_t cookie)
if (!_get_cookie_sem(cookie, &semid))
return_0;
+ /* Return immediately if the semaphore value exceeds 1? */
+ if (*nowait) {
+ if ((val = semctl(semid, 0, GETVAL)) < 0) {
+ log_error("semid %d: sem_ctl GETVAL failed for "
+ "cookie 0x%" PRIx32 ": %s",
+ semid, cookie, strerror(errno));
+ return 0;
+ }
+
+ if (val > 1)
+ return 1;
+
+ *nowait = 0;
+ }
+
if (!_udev_notify_sem_dec(cookie, semid)) {
log_error("Failed to set a proper state for notification "
"semaphore identified by cookie value %" PRIu32 " (0x%x) "
@@ -2548,11 +2577,27 @@ repeat_wait:
int dm_udev_wait(uint32_t cookie)
{
- int r = _udev_wait(cookie);
+ int nowait = 0;
+ int r = _udev_wait(cookie, &nowait);
update_devs();
return r;
}
+int dm_udev_wait_immediate(uint32_t cookie, int *ready)
+{
+ int nowait = 1;
+ int r = _udev_wait(cookie, &nowait);
+
+ if (r && nowait) {
+ *ready = 0;
+ return 1;
+ }
+
+ update_devs();
+ *ready = 1;
+
+ return r;
+}
#endif /* UDEV_SYNC_SUPPORT */
7 years, 4 months
master - pvscan: autoactivation should ignore some VGs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2d2a61339b83d...
Commit: a2d2a61339b83de0d48ed6ed15e816773393c6b4
Parent: 263c1a4db51184c718e85c1c3fdcef7908dd7c88
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 27 15:33:23 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 27 15:45:38 2016 -0500
pvscan: autoactivation should ignore some VGs
pvscan autoactivation has its own VG processing implementation,
so it can't properly handle things like foreign or shared VGs,
so make it ignore those VG types (or errors from them) as best
as possible.
Add a FIXME stating that pvscan autoactivation must really be
moved to the standard VG processing by calling process_each_vg
to do activation once the scanning / cache update is finished.
---
tools/pvscan.c | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 425383a..d93773a 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -132,6 +132,7 @@ static int _auto_activation_handler(struct cmd_context *cmd,
int refresh_done = 0;
struct volume_group *vg;
struct id vgid_raw;
+ uint32_t read_error;
int r = 0;
/* TODO: add support for partial and clustered VGs */
@@ -141,16 +142,45 @@ static int _auto_activation_handler(struct cmd_context *cmd,
if (!id_read_format(&vgid_raw, vgid))
return_0;
+ /*
+ * FIXME: pvscan activation really needs to be changed to use
+ * the standard process_each_vg() interface. It should save
+ * a list of VG names that are found during the scan, then
+ * call process_each_vg() with that list to do activation.
+ */
+
+ cmd->vg_read_print_access_error = 0;
+
/* NB. This is safe because we know lvmetad is running and we won't hit disk. */
vg = vg_read(cmd, vgname, (const char *)&vgid_raw, 0, 0);
- if (vg_read_error(vg)) {
+ read_error = vg_read_error(vg);
+ if (read_error) {
+ /*
+ * foreign VGs: we want to read and update lvmetad, but that's
+ * all, we don't want to even attempt to autoactivate.
+ *
+ * shared VGs: we want to read and update lvmetad, and for now
+ * ignore them for autoactivation. Once pvscan autoactivation
+ * uses process_each_vg, then shared VGs could be autoactivated.
+ */
+ if (read_error & (FAILED_SYSTEMID | FAILED_LOCK_TYPE | FAILED_LOCK_MODE)) {
+ release_vg(vg);
+ return 1;
+ }
+
log_error("Failed to read Volume Group \"%s\" (%s) during autoactivation.", vgname, vgid);
release_vg(vg);
return 0;
}
+ if (is_lockd_type(vg->lock_type)) {
+ r = 1;
+ goto out;
+ }
+
if (vg_is_clustered(vg)) {
- r = 1; goto out;
+ r = 1;
+ goto out;
}
/* FIXME: There's a tiny race when suspending the device which is part
7 years, 4 months
master - lvmetad: improve warning after lvmetad message fails
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=263c1a4db51184...
Commit: 263c1a4db51184c718e85c1c3fdcef7908dd7c88
Parent: 3c53acb378478f23acf624be8836c0cb24c2724e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 27 14:49:27 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 27 15:38:34 2016 -0500
lvmetad: improve warning after lvmetad message fails
Make it more consistent with the other similar warning.
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 8a1a2c5..8b63696 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -643,7 +643,7 @@ fail:
* commands will not use it until it's been properly repopulated.
*/
if (action_modifies)
- log_error("lvmetad update failed. Restart lvmetad immediately.");
+ log_warn("WARNING: To avoid corruption, restart lvmetad (or disable with use_lvmetad=0).");
return 0;
}
7 years, 4 months
master - metadata: fix segfault when filters reject devices
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3c53acb378478f...
Commit: 3c53acb378478f23acf624be8836c0cb24c2724e
Parent: 49f32e4859017104555ba0297fa0384d4aa3d5f2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 27 12:13:26 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 27 12:13:26 2016 -0500
metadata: fix segfault when filters reject devices
Checking for devices uses is_missing_pv() to check
if there is a device for the PV. is_missing_pv()
is based on the MISSING_PV flag, which does not
always correspond to !pv->dev. When using lvmetad,
a command like:
pvs --config 'devices/filter=["a|/dev/sdb|", "r|.*|"]'
will cause a number of PVs to have NULL pv->dev, but
not the MISSING_PV flag. So, NULL pv->dev needs to
also be checked.
---
lib/metadata/metadata.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 6d101e0..c8237d5 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4682,6 +4682,15 @@ static int _check_devs_used_correspond_with_vg(struct volume_group *vg)
/* Mark all PVs in VG as used. */
dm_list_iterate_items(pvl, &vg->pvs) {
+ /*
+ * FIXME: It's not clear if the meaning
+ * of "missing" should always include the
+ * !pv->dev case, or if "missing" is the
+ * more narrow case where VG metadata has
+ * been written with the MISSING flag.
+ */
+ if (!pvl->pv->dev)
+ continue;
if (is_missing_pv(pvl->pv))
continue;
pvl->pv->dev->flags |= DEV_ASSUMED_FOR_LV;
7 years, 4 months
master - cache: better support for alias check
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=49f32e48590171...
Commit: 49f32e4859017104555ba0297fa0384d4aa3d5f2
Parent: 2a2efab0b11b7bfeef1a60b6cfd61c8bceb67164
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 27 00:19:04 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 27 00:20:37 2016 +0200
cache: better support for alias check
To still support disabling of policies for test we need
better logic for alias detection introduced in
588455d03ea40ffa37f466023691b0ec2bdf5e82.
---
lib/cache_segtype/cache.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index be9a57e..199bda6 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -208,12 +208,13 @@ static int _target_present(struct cmd_context *cmd,
uint32_t maj;
uint32_t min;
unsigned cache_feature;
+ unsigned cache_alias;
const char feature[12];
const char module[12]; /* check dm-%s */
} _features[] = {
- { 1, 9, CACHE_FEATURE_POLICY_SMQ | CACHE_FEATURE_POLICY_MQ, "policy_smq", "cache-smq" },
- { 1, 8, CACHE_FEATURE_POLICY_SMQ, "policy_smq", "cache-smq" },
- { 1, 3, CACHE_FEATURE_POLICY_MQ, "policy_mq", "cache-mq" },
+ { 1, 9, 0, CACHE_FEATURE_POLICY_MQ, "policy_smq", "cache-smq" },
+ { 1, 8, CACHE_FEATURE_POLICY_SMQ, 0, "policy_smq", "cache-smq" },
+ { 1, 3, CACHE_FEATURE_POLICY_MQ, 0, "policy_mq", "cache-mq" },
};
static const char _lvmconf[] = "global/cache_disabled_features";
static unsigned _attrs = 0;
@@ -253,7 +254,8 @@ static int _target_present(struct cmd_context *cmd,
(!_features[i].module[0] ||
(_attrs & _features[i].cache_feature) || /* already present */
module_present(cmd, _features[i].module)))
- _attrs |= _features[i].cache_feature;
+ _attrs |= _features[i].cache_feature |
+ _features[i].cache_alias;
else
log_very_verbose("Target %s does not support %s.",
_cache_module, _features[i].feature);
7 years, 4 months