master - toollib: fix wrong paren placement
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=44ba862674c995...
Commit: 44ba862674c995e2ed297714d3aa2b2dbd731ad1
Parent: 6624833839645cbe75af073fd1dd9ab8c78e0d03
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 26 16:27:26 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 26 16:27:26 2015 -0500
toollib: fix wrong paren placement
---
tools/toollib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 843a47b..59ba29f 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3119,7 +3119,7 @@ int process_each_pv(struct cmd_context *cmd,
return ret;
}
- if ((ret = _get_arg_devices(cmd, &arg_pvnames, &arg_devices) != ECMD_PROCESSED))
+ if ((ret = _get_arg_devices(cmd, &arg_pvnames, &arg_devices)) != ECMD_PROCESSED)
/* get_arg_devices reports the error for any PV names not found. */
ret_max = ECMD_FAILED;
8 years, 5 months
master - pvs: fix missing PVs when VG is removed
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6624833839645c...
Commit: 6624833839645cbe75af073fd1dd9ab8c78e0d03
Parent: b29593378f41f6dd401fb9582fba1a100f33dbbb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 23 15:09:20 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 26 16:07:12 2015 -0500
pvs: fix missing PVs when VG is removed
PVs could be missing from the 'pvs' output if
their VG was removed at the same time that the
'pvs' command was run. To fix this:
1. If a VG is not found when processed, don't
silently skip the PVs in it, as is done when
the "skip" variable is set.
2. Repeat the VG search if some PVs are not
found on the first search through all VGs.
The second search uses a specific list of
PVs that were missed the first time.
testing:
/dev/sdb is a PV
/dev/sdd is a PV
/dev/sdg is not a PV
each test begins with:
vgcreate test /dev/sdb /dev/sdd
variations to test:
vgremove -f test & pvs
vgremove -f test & pvs -a
vgremove -f test & pvs /dev/sdb /dev/sdd
vgremove -f test & pvs /dev/sdg
vgremove -f test & pvs /dev/sdb /dev/sdg
The pvs command should always display /dev/sdb
and /dev/sdd, either as a part of VG test or not.
The pvs command should always print an error
indicating that /dev/sdg could not be found.
---
tools/toollib.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 116 insertions(+), 9 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index fba075a..843a47b 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -184,14 +184,16 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
* If *skip is 1, it's OK for the caller to read the list of PVs in the VG.
*/
static int _ignore_vg(struct volume_group *vg, const char *vg_name,
- struct dm_list *arg_vgnames, uint32_t read_flags, int *skip)
+ struct dm_list *arg_vgnames, uint32_t read_flags,
+ int *skip, int *notfound)
{
uint32_t read_error = vg_read_error(vg);
+
*skip = 0;
+ *notfound = 0;
if ((read_error & FAILED_NOTFOUND) && (read_flags & READ_OK_NOTFOUND)) {
- read_error &= ~FAILED_NOTFOUND;
- *skip = 1;
+ *notfound = 1;
return 0;
}
@@ -1924,6 +1926,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
int process_all = 0;
/*
@@ -1942,6 +1945,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -1949,12 +1953,12 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
}
- if (skip)
+ if (skip || notfound)
goto endvg;
/* Process this VG? */
@@ -2392,6 +2396,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, vgnameids_to_process) {
if (sigint_caught())
@@ -2400,6 +2405,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
/*
* arg_lvnames contains some elements that are just "vgname"
@@ -2437,13 +2443,12 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
-
}
- if (skip)
+ if (skip || notfound)
goto endvg;
ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg, 0,
@@ -2688,6 +2693,59 @@ static struct device_id_list *_device_list_find_pvid(struct dm_list *devices, st
return NULL;
}
+static int _device_list_copy(struct cmd_context *cmd, struct dm_list *src, struct dm_list *dst)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_new;
+
+ dm_list_iterate_items(dil, src) {
+ if (!(dil_new = dm_pool_alloc(cmd->mem, sizeof(*dil_new)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_new->dev = dil->dev;
+ strncpy(dil_new->pvid, dil->pvid, ID_LEN);
+ dm_list_add(dst, &dil_new->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
+/*
+ * For each device in arg_devices or all_devices that has a pvid, add a copy of
+ * that device to arg_missed. All PVs (devices with a pvid) should have been
+ * found while processing all VGs (including orphan VGs). But, some may have
+ * been missed if VGs were changing at the same time. This function creates a
+ * list of PVs that still remain in the given list, i.e. were missed the first
+ * time. A second iteration through VGs can look for these explicitly.
+ * (arg_devices is used if specific PVs are being processed; all_devices is
+ * used if all devs are being processed)
+ */
+static int _get_missed_pvs(struct cmd_context *cmd,
+ struct dm_list *devices,
+ struct dm_list *arg_missed)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_missed;
+
+ dm_list_iterate_items(dil, devices) {
+ if (!dil->pvid[0])
+ continue;
+
+ if (!(dil_missed = dm_pool_alloc(cmd->mem, sizeof(*dil_missed)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_missed->dev = dil->dev;
+ strncpy(dil_missed->pvid, dil->pvid, ID_LEN);
+ dm_list_add(arg_missed, &dil_missed->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_devices,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
@@ -2921,6 +2979,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, all_vgnameids) {
if (sigint_caught())
@@ -2929,6 +2988,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -2936,13 +2996,15 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
- if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
if (!skip)
goto endvg;
/* Drop through to eliminate a clustered VG's PVs from the devices list */
}
+ if (notfound)
+ goto endvg;
/*
* Don't continue when skip is set, because we need to remove
@@ -2982,6 +3044,7 @@ int process_each_pv(struct cmd_context *cmd,
struct dm_list arg_tags; /* str_list */
struct dm_list arg_pvnames; /* str_list */
struct dm_list arg_devices; /* device_id_list */
+ struct dm_list arg_missed; /* device_id_list */
struct dm_list all_vgnameids; /* vgnameid_list */
struct dm_list all_devices; /* device_id_list */
struct device_id_list *dil;
@@ -3009,6 +3072,7 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_tags);
dm_list_init(&arg_pvnames);
dm_list_init(&arg_devices);
+ dm_list_init(&arg_missed);
dm_list_init(&all_vgnameids);
dm_list_init(&all_devices);
@@ -3068,6 +3132,49 @@ int process_each_pv(struct cmd_context *cmd,
if (ret > ret_max)
ret_max = ret;
+ /*
+ * Some PVs may have been missed by the first search if another command
+ * moved them at the same time. Repeat the search for only the
+ * specific PVs missed. lvmcache needs clearing for a fresh search.
+ *
+ * If missed PVs are found in this repeated search, they are removed
+ * from the arg_missed list, but they also need to be removed from the
+ * arg_devices list, otherwise the check at the end will produce an
+ * error, thinking they weren't found. This is the reason for saving
+ * and comparing the original arg_missed list.
+ */
+ if (!process_all_pvs)
+ _get_missed_pvs(cmd, &arg_devices, &arg_missed);
+ else
+ _get_missed_pvs(cmd, &all_devices, &arg_missed);
+
+ if (!dm_list_empty(&arg_missed)) {
+ struct dm_list arg_missed_orig;
+
+ dm_list_init(&arg_missed_orig);
+ _device_list_copy(cmd, &arg_missed, &arg_missed_orig);
+
+ log_warn("Some PVs were not found in first search, retrying.");
+
+ lvmcache_destroy(cmd, 0, 0);
+ lvmcache_init();
+ lvmcache_seed_infos_from_lvmetad(cmd);
+
+ ret = _process_pvs_in_vgs(cmd, read_flags, &all_vgnameids, &all_devices,
+ &arg_missed, &arg_tags, 0, 0,
+ handle, process_single_pv);
+ if (ret != ECMD_PROCESSED)
+ stack;
+ if (ret > ret_max)
+ ret_max = ret;
+
+ /* Devices removed from arg_missed are removed from arg_devices. */
+ dm_list_iterate_items(dil, &arg_missed_orig) {
+ if (!_device_list_find_dev(&arg_missed, dil->dev))
+ _device_list_remove(&arg_devices, dil->dev);
+ }
+ }
+
dm_list_iterate_items(dil, &arg_devices) {
log_error("Failed to find physical volume \"%s\".", dev_name(dil->dev));
ret_max = ECMD_FAILED;
8 years, 5 months
master - tests: snapshot now respects threshold
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b29593378f41f6...
Commit: b29593378f41f6dd401fb9582fba1a100f33dbbb
Parent: 428ca9b1207eba53ffc721bd9e528a1a148128c2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 07:38:23 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 07:38:23 2015 +0100
tests: snapshot now respects threshold
---
test/shell/snapshot-usage.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index ed9d8cb..d15eee1 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -169,13 +169,13 @@ lvcreate -s -l12 $vg1/lvol0
fill 1K
check lv_field $vg1/lvol1 data_percent "100.00"
-# Check it resizes 100% full valid snapshot
+# Check it resizes 100% full valid snapshot to fit threshold
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 data_percent "80.00"
+check lv_field $vg1/lvol1 data_percent "50.00"
fill 4K
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 size "18.00k"
+check lv_field $vg1/lvol1 size "24.00k"
lvextend -l+33 $vg1/lvol1
check lv_field $vg1/lvol1 size "$EXPECT3"
8 years, 5 months
master - libdm: enable no_flush for driver version > 11
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=428ca9b1207eba...
Commit: 428ca9b1207eba53ffc721bd9e528a1a148128c2
Parent: f898cf7539149a54a121b0aae59076c2d647bb37
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 07:37:59 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 07:37:59 2015 +0100
libdm: enable no_flush for driver version > 11
It appears the driver version 11 has troubles with usage of no_flush
So require at least version 12.
---
libdm/ioctl/libdm-iface.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 58a8dfe..2a36b77 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1202,8 +1202,13 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
if (dmt->type == DM_DEVICE_SUSPEND)
dmi->flags |= DM_SUSPEND_FLAG;
- if (dmt->no_flush)
- dmi->flags |= DM_NOFLUSH_FLAG;
+ if (dmt->no_flush) {
+ if (_dm_version_minor < 12)
+ log_verbose("No flush flag unsupported by kernel. "
+ "Buffers will be flushed.");
+ else
+ dmi->flags |= DM_NOFLUSH_FLAG;
+ }
if (dmt->read_only)
dmi->flags |= DM_READONLY_FLAG;
if (dmt->skip_lockfs)
8 years, 5 months
master - tests: snapshot now respects threshold
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3466cd8a6caff3...
Commit: 3466cd8a6caff3ca9ad00e22b927dbe22404fe5c
Parent: 6e784abbd7336e57fee80dfb6a5a3e7f2fab7a98
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 07:34:33 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 07:34:33 2015 +0100
tests: snapshot now respects threshold
---
test/shell/snapshot-usage.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index ed9d8cb..d15eee1 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -169,13 +169,13 @@ lvcreate -s -l12 $vg1/lvol0
fill 1K
check lv_field $vg1/lvol1 data_percent "100.00"
-# Check it resizes 100% full valid snapshot
+# Check it resizes 100% full valid snapshot to fit threshold
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 data_percent "80.00"
+check lv_field $vg1/lvol1 data_percent "50.00"
fill 4K
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 size "18.00k"
+check lv_field $vg1/lvol1 size "24.00k"
lvextend -l+33 $vg1/lvol1
check lv_field $vg1/lvol1 size "$EXPECT3"
8 years, 5 months
master - libdm: enable no_flush for driver version > 11
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e784abbd7336e...
Commit: 6e784abbd7336e57fee80dfb6a5a3e7f2fab7a98
Parent: f898cf7539149a54a121b0aae59076c2d647bb37
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 07:34:14 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 07:34:14 2015 +0100
libdm: enable no_flush for driver version > 11
It appears the driver version 11 has troubles with usage of no_flush
So require at least version 12.
---
libdm/ioctl/libdm-iface.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 58a8dfe..615bbd5 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1202,8 +1202,13 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
if (dmt->type == DM_DEVICE_SUSPEND)
dmi->flags |= DM_SUSPEND_FLAG;
- if (dmt->no_flush)
- dmi->flags |= DM_NOFLUSH_FLAG;
+ if (dmt->no_flush) {
+ if (_dm_version_minor < 11)
+ log_verbose("No flush flag unsupported by kernel. "
+ "Buffers will be flushed.");
+ else
+ dmi->flags |= DM_NOFLUSH_FLAG;
+ }
if (dmt->read_only)
dmi->flags |= DM_READONLY_FLAG;
if (dmt->skip_lockfs)
8 years, 5 months
master - tests: snapshot now respects threshold
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76b49318b7b1d9...
Commit: 76b49318b7b1d99f16ecf8069d4cb1786bfc124f
Parent: 9139d7a4bbaf0b6944802b7c6f893e23b59633f7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 23:44:58 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 23:44:58 2015 +0100
tests: snapshot now respects threshold
---
test/shell/snapshot-usage.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index ed9d8cb..d15eee1 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -169,13 +169,13 @@ lvcreate -s -l12 $vg1/lvol0
fill 1K
check lv_field $vg1/lvol1 data_percent "100.00"
-# Check it resizes 100% full valid snapshot
+# Check it resizes 100% full valid snapshot to fit threshold
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 data_percent "80.00"
+check lv_field $vg1/lvol1 data_percent "50.00"
fill 4K
lvextend --use-policies $vg1/lvol1
-check lv_field $vg1/lvol1 size "18.00k"
+check lv_field $vg1/lvol1 size "24.00k"
lvextend -l+33 $vg1/lvol1
check lv_field $vg1/lvol1 size "$EXPECT3"
8 years, 5 months
master - libdm: enable no_flush for driver version > 11
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9139d7a4bbaf0b...
Commit: 9139d7a4bbaf0b6944802b7c6f893e23b59633f7
Parent: f898cf7539149a54a121b0aae59076c2d647bb37
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 23:43:47 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 23:43:47 2015 +0100
libdm: enable no_flush for driver version > 11
It appears the driver version 11 has troubles with usage of no_flush
So require at least version 12.
---
libdm/ioctl/libdm-iface.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 58a8dfe..615bbd5 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1202,8 +1202,13 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
if (dmt->type == DM_DEVICE_SUSPEND)
dmi->flags |= DM_SUSPEND_FLAG;
- if (dmt->no_flush)
- dmi->flags |= DM_NOFLUSH_FLAG;
+ if (dmt->no_flush) {
+ if (_dm_version_minor < 11)
+ log_verbose("No flush flag unsupported by kernel. "
+ "Buffers will be flushed.");
+ else
+ dmi->flags |= DM_NOFLUSH_FLAG;
+ }
if (dmt->read_only)
dmi->flags |= DM_READONLY_FLAG;
if (dmt->skip_lockfs)
8 years, 5 months
master - dev_manager: no flush for extension
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f898cf7539149a...
Commit: f898cf7539149a54a121b0aae59076c2d647bb37
Parent: 844b00958492224c448b30f89ae5532bb6591fd2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:41:19 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:09:31 2015 +0100
dev_manager: no flush for extension
Recognize the target only 'extends' and do not enforce
'flush' in this case. Only the size reduction
still requires flush (so disables usage of no_flush flag).
If some other targets do require flush before suspend,
they have to explicitly ask for it.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 33d11a4..80a198a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enforce flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 1caa2d7..dc6d2fd 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3296,7 +3296,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if (!dm_tree_preload_children(root, dlid, DLID_SIZE))
goto_out;
- if (dm_tree_node_size_changed(root))
+ if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
if (action == ACTIVATE) {
8 years, 5 months
master - dev_manager: enabled no_flush for suspend
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=844b0095849222...
Commit: 844b00958492224c448b30f89ae5532bb6591fd2
Parent: 9ef820a2a5e174cd08097981d7879e1f4cbded01
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:37:39 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:07:37 2015 +0100
dev_manager: enabled no_flush for suspend
While the activation code tries to evaluate which target
really needs flush with suspend and which may go without flush,
it has stayed effectively disabled by original commit:
33f732c5e9493cda4b161a18b3d53885d207e3b8 since here
it only allows to pass non-pvmoving 'mirrors'.
So remove check for mirror LV type and only disable
no_flush for 'pvmove'..
TODO: Looking into history - it also seemed like raid target
would have always required flushing but it's been later
removed without clean explanation.
If some more targets really do need 'no_flush' it should
been handle at their 'level' - since we now stack multiple
targets over itself.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8ca0aa7..33d11a4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index a5ee824..1caa2d7 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3277,7 +3277,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
break;
case SUSPEND:
dm_tree_skip_lockfs(root);
- if (!dm->flush_required && lv_is_mirror(lv) && !lv_is_pvmove(lv))
+ if (!dm->flush_required && !lv_is_pvmove(lv))
dm_tree_use_no_flush_suspend(root);
/* Fall through */
case SUSPEND_WITH_LOCKFS:
8 years, 5 months