Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cf97d8d5f9449a21…
Commit: cf97d8d5f9449a2102f3e6c92efe4987744c96e9
Parent: 91b26b63b408b7d7b4f79f0754d190783874e4cc
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 20 12:54:10 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 20 12:54:10 2014 +0100
udev: clear temporary variable properly
Clear temporary DM_DISABLE_OTHER_RULES_FLAG properly. This did not
cause any bug or problem as the temporary variable is overwritten next
time it's used again, but we should still clean it properly!
---
udev/11-dm-lvm.rules.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/udev/11-dm-lvm.rules.in b/udev/11-dm-lvm.rules.in
index 9ca0375..91cb991 100644
--- a/udev/11-dm-lvm.rules.in
+++ b/udev/11-dm-lvm.rules.in
@@ -33,7 +33,7 @@ IMPORT{program}="(DM_EXEC)/dmsetup splitname --nameprefixes --noheadings --rows
ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_NOSCAN}="1", ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD"
ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}", \
- ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG_OLD}="", ENV{DM_NOSCAN}=""
+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="", ENV{DM_NOSCAN}=""
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=91b26b63b408b7d7…
Commit: 91b26b63b408b7d7b4f79f0754d190783874e4cc
Parent: 79768b2e9c01f6a56d6e2fef7d3bd82f9ce3c2c1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 20 12:38:21 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 20 12:38:21 2014 +0100
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.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 18 ++++++++++++++----
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,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79768b2e9c01f6a5…
Commit: 79768b2e9c01f6a56d6e2fef7d3bd82f9ce3c2c1
Parent: 59336a2a0626eba91dc3bc76ff6297e0c70e7e9e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 12:02:33 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 12:02:33 2014 +0100
tests: update testing for xfs
---
WHATS_NEW | 1 +
test/shell/fsadm.sh | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 834cf0f..6f7abe6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ 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)
Mark pool format metadata as FMT_OBSOLETE.
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 4e624db..8d4b37d 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2008-2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -24,7 +24,9 @@ check_reiserfs=
which mkfs.ext3 || check_ext3=${check_ext3:-mkfs.ext3}
which fsck.ext3 || check_ext3=${check_ext3:-fsck.ext3}
which mkfs.xfs || check_xfs=${check_xfs:-mkfs.xfs}
-which xfs_check || check_xfs=${check_xfs:-xfs_check}
+which xfs_check || {
+ which xfs_repair || check_xfs=${check_xfs:-xfs_repair}
+}
which mkfs.reiserfs || check_reiserfs=${check_reiserfs:-mkfs.reiserfs}
which reiserfsck || check_reiserfs=${check_reiserfs:-reiserfsck}
@@ -54,7 +56,11 @@ fscheck_ext3()
fscheck_xfs()
{
- xfs_check "$dev_vg_lv"
+ if which xfs_repair ; then
+ xfs_repair -n "$dev_vg_lv"
+ else
+ xfs_check "$dev_vg_lv"
+ fi
}
fscheck_reiserfs()
@@ -67,8 +73,9 @@ check_missing()
eval local t=$\check_$1
test -z "$t" && return 0
test "$t" = skip && return 1
- # trick for warning test
- echo "WARNING: fsadm test skipped $1 tests, $t tool is missing"
+ # trick to get test listed with warning
+ echo "WARNING: fsadm test skipped $1 tests, $t tool is missing."
+ should false;
return 1
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=59336a2a0626eba9…
Commit: 59336a2a0626eba91dc3bc76ff6297e0c70e7e9e
Parent: 5f9035363684953d66c076f0f874d12d0576b4b2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 11:57:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 11:57:39 2014 +0100
fsadm: use xfs_repair when available
Since support for xfs_check is going to be obsoleted,
replace its usage with xfs_repair -n tool.
However this tool needs further intrumentation, since for really small
xfs devices (having just 1 allocation group) it needs to pass in
flag: "-o force_geometry". As we run the tool with '-n', it should
be safe to pass this flag always.
FIXME: figure way without always passing this flag.
---
scripts/fsadm.sh | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 1e8a22a..e6fe7ce 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -54,6 +54,8 @@ READLINK=readlink
READLINK_E="-e"
FSCK=fsck
XFS_CHECK=xfs_check
+# XFS_REPAIR -n is used when XFS_CHECK is not found
+XFS_REPAIR=xfs_repair
# user may override lvm location by setting LVM_BINARY
LVM=${LVM_BINARY:-lvm}
@@ -430,7 +432,15 @@ check() {
esac
case "$FSTYPE" in
- "xfs") dry "$XFS_CHECK" "$VOLUME" ;;
+ "xfs") if which "$XFS_CHECK" >"$NULL" 2>&1 ; then
+ dry "$XFS_CHECK" "$VOLUME"
+ else
+ # Replacement for outdated xfs_check
+ # FIXME: for small devices we need to force_geometry,
+ # since we run in '-n' mode, it shouldn't be problem.
+ # Think about better way....
+ dry "$XFS_REPAIR" -n -o force_geometry "$VOLUME"
+ fi ;;
*) # check if executed from interactive shell environment
case "$-" in
*i*) dry "$FSCK" $YES $FORCE "$VOLUME" ;;
@@ -452,7 +462,8 @@ test -n "$FSADM_RUNNING" && exit 0
test -n "$TUNE_EXT" -a -n "$RESIZE_EXT" -a -n "$TUNE_REISER" -a -n "$RESIZE_REISER" \
-a -n "$TUNE_XFS" -a -n "$RESIZE_XFS" -a -n "$MOUNT" -a -n "$UMOUNT" -a -n "$MKDIR" \
-a -n "$RMDIR" -a -n "$BLOCKDEV" -a -n "$BLKID" -a -n "$GREP" -a -n "$READLINK" \
- -a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "$LVM" \
+ -a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "$XFS_REPAIR" \
+ -a -n "$LVM" \
|| error "Required command definitions in the script are missing!"
"$LVM" version >"$NULL" 2>&1 || error "Could not run lvm binary \"$LVM\""