summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2014-01-20 11:38:21 (GMT)
committerPeter Rajnoha <prajnoha@redhat.com>2014-01-20 11:38:21 (GMT)
commit91b26b63b408b7d7b4f79f0754d190783874e4cc (patch)
tree73b82ba00382fe25a08aff0618796fbcf957091a
parent79768b2e9c01f6a56d6e2fef7d3bd82f9ce3c2c1 (diff)
downloadlvm2-91b26b63b408b7d7b4f79f0754d190783874e4cc.zip
lvm2-91b26b63b408b7d7b4f79f0754d190783874e4cc.tar.gz
lvm2-91b26b63b408b7d7b4f79f0754d190783874e4cc.tar.xz
thin: fix thin LV flagging for udev to skip scanning
Only flag thin LV for no scanning in udev if this LV is about to be wiped. This happens only in case the thin LV's pool was not created with zeroing of the new blocks enabled.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/lv_manip.c18
2 files changed, 15 insertions, 4 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 6f7abe6..284c92e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ Fix thin LV flagging for udev to skip scanning only if the LV is wiped
Replace use of xfs_check with xfs_reparir in fsadm.
Mark lvm1 format metadata as FMT_OBSOLETE. Do not use it with lvmetad.
Invalidate cached VG struct after a PV in it gets orphaned. (2.02.87)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 62ca245..f45c89f 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5634,6 +5634,18 @@ out:
return 1;
}
+static int _should_wipe_lv(struct lvcreate_params *lp, struct logical_volume *lv) {
+ int r = lp->zero | lp->wipe_signatures;
+
+ if (!seg_is_thin(lp))
+ return r;
+
+ if (lv_is_thin_volume(lv))
+ return r && !lp->snapshot && !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks;
+
+ return 0;
+}
+
/* Thin notes:
* If lp->thin OR lp->activate is AY*, activate the pool if not already active.
* If lp->thin, create thin LV within the pool - as a snapshot if lp->snapshot.
@@ -6029,7 +6041,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
/* Do not scan this LV until properly zeroed/wiped. */
- if (lp->zero | lp->wipe_signatures)
+ if (_should_wipe_lv(lp, lv))
lv->status |= LV_NOSCAN;
if (lp->temporary)
@@ -6110,9 +6122,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
log_verbose("Signature wiping on \"%s/%s\" not requested", lv->vg->name, lv->name);
}
- if ((!seg_is_thin(lp) ||
- (lv_is_thin_volume(lv) && !lp->snapshot &&
- !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks))) {
+ if (_should_wipe_lv(lp, lv)) {
if (!wipe_lv(lv, (struct wipe_params)
{
.do_zero = lp->zero,