diff options
Diffstat (limited to 'core/lvm2/0002-snapshot-zero-cow-header-for-read-only-snapshot.patch')
-rw-r--r-- | core/lvm2/0002-snapshot-zero-cow-header-for-read-only-snapshot.patch | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/core/lvm2/0002-snapshot-zero-cow-header-for-read-only-snapshot.patch b/core/lvm2/0002-snapshot-zero-cow-header-for-read-only-snapshot.patch deleted file mode 100644 index b1f9775bb..000000000 --- a/core/lvm2/0002-snapshot-zero-cow-header-for-read-only-snapshot.patch +++ /dev/null @@ -1,74 +0,0 @@ -From d5c2c146ee050905a175b73dd3d0155f46d5cf81 Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac <zkabelac@redhat.com> -Date: Wed, 26 Feb 2014 00:17:11 +0100 -Subject: [PATCH 2/2] snapshot: zero cow header for read-only snapshot -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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. - -Conflicts: - WHATS_NEW - -[Backported to 2.02.105 by Thomas Bächler (thomas@archlinux.org)] ---- - WHATS_NEW | 1 + - test/shell/snapshot-usage.sh | 11 +++++++++++ - tools/lvcreate.c | 8 ++++++-- - 3 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index d2a3482..eeb3517 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,3 +1,4 @@ -+ Zero snapshot COW header when creating read-only snapshot. - Wipe DM_snapshot_cow signature without prompt in new LVs with blkid wiping. - - Version 2.02.105 - 20th January 2014 -diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh -index 9e6a14f..17abe9b 100644 ---- a/test/shell/snapshot-usage.sh -+++ b/test/shell/snapshot-usage.sh -@@ -128,4 +128,15 @@ vgremove -ff $vg1 - - fi - -+lvremove -f $vg -+ -+# Check snapshot really deletes COW header for read-only snapshot -+aux lvmconf "allocation/wipe_signatures_when_zeroing_new_lvs = 1" -+lvcreate -L10 -n $lv1 $vg -+lvcreate -s -L10 -n snap $vg/$lv1 -+# Populate snapshot with some filesystem signatures -+mkfs.ext4 "$DM_DEV_DIR/$vg/snap" -+lvremove -f $vg/snap -+lvcreate -s -pr -l12 -n snap $vg/$lv1 -+ - vgremove -ff $vg -diff --git a/tools/lvcreate.c b/tools/lvcreate.c -index d0ca7bc..e8270c4 100644 ---- a/tools/lvcreate.c -+++ b/tools/lvcreate.c -@@ -644,8 +644,12 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex - lp->permission = arg_uint_value(cmd, permission_ARG, - LVM_READ | LVM_WRITE); - -- /* Must not zero/wipe read only volume */ -- if (!(lp->permission & LVM_WRITE)) { -+ if (lp->snapshot) { -+ /* Snapshot has to zero COW header */ -+ lp->zero = 1; -+ lp->wipe_signatures = 0; -+ } else if (!(lp->permission & LVM_WRITE)) { -+ /* Must not zero/wipe read only volume */ - lp->zero = 0; - lp->wipe_signatures = 0; - } --- -1.9.0 - |