From 59d3c6058a133f74815a3fd8a9781a8555cafd63 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 28 2017 15:10:33 +0000 Subject: import xfsprogs-4.5.0-10.el7_3 --- diff --git a/SOURCES/xfsprogs-4.8.0-xfs_copy-UUID.patch b/SOURCES/xfsprogs-4.8.0-xfs_copy-UUID.patch new file mode 100644 index 0000000..7c22843 --- /dev/null +++ b/SOURCES/xfsprogs-4.8.0-xfs_copy-UUID.patch @@ -0,0 +1,79 @@ +commit cbca895541facb3a1a00fd0fe6614301a64c0e3a +Author: Eric Sandeen +Date: Fri Sep 23 09:16:52 2016 +1000 + + xfs_copy: Fix meta UUID handling on multiple copies + + Zorro reported that when making multiple copies of a V5 + filesystem with xfs_copy while generating new UUIDs, all + but the first copy were corrupt. + + Upon inspection, the corruption was related to incorrect UUIDs; + the original UUID, as stamped into every metadata structure, + was not preserved in the sb_meta_uuid field of the superblock + on any but the first copy. + + This happened because sb_update_uuid was using the UUID present in + the ag_hdr structure as the unchanging meta-uuid which is to match + existing structures, but it also /updates/ that UUID with the + new identifying UUID present in tcarg. So the newly-generated + UUIDs moved transitively from tcarg->uuid to ag_hdr->xfs_sb->sb_uuid + to ag_hdr->xfs_sb->sb_meta_uuid each time the function got called. + + Fix this by looking instead to the unchanging, original UUID + present in the xfs_sb_t we are given, which reflects the original + filesystem's metadata UUID, and copy /that/ UUID into each target + filesystem's meta_uuid field. + + Most of this patch is changing comments and re-ordering tests + to match; the functional change is to simply use the *sb rather + than the *ag_hdr to identify the proper metadata UUID. + + Reported-and-tested-by: Zorro Lang + Signed-off-by: Eric Sandeen + Reviewed-by: Dave Chinner + Signed-off-by: Dave Chinner + +diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c +index 3c8998c..22ded6b 100644 +--- a/copy/xfs_copy.c ++++ b/copy/xfs_copy.c +@@ -494,27 +494,29 @@ write_wbuf(void) + + void + sb_update_uuid( +- xfs_sb_t *sb, +- ag_header_t *ag_hdr, +- thread_args *tcarg) ++ xfs_sb_t *sb, /* Original fs superblock */ ++ ag_header_t *ag_hdr, /* AG hdr to update for this copy */ ++ thread_args *tcarg) /* Args for this thread, with UUID */ + { + /* + * If this filesystem has CRCs, the original UUID is stamped into +- * all metadata. If we are changing the UUID in the copy, we need +- * to copy the original UUID into the meta_uuid slot and set the +- * set the incompat flag if that hasn't already been done. ++ * all metadata. If we don't have an existing meta_uuid field in the ++ * the original filesystem and we are changing the UUID in this copy, ++ * we must copy the original sb_uuid to the sb_meta_uuid slot and set ++ * the incompat flag for the feature on this copy. + */ +- if (!uuid_equal(&tcarg->uuid, &ag_hdr->xfs_sb->sb_uuid) && +- xfs_sb_version_hascrc(sb) && !xfs_sb_version_hasmetauuid(sb)) { ++ if (xfs_sb_version_hascrc(sb) && !xfs_sb_version_hasmetauuid(sb) && ++ !uuid_equal(&tcarg->uuid, &sb->sb_uuid)) { + __be32 feat; + + feat = be32_to_cpu(ag_hdr->xfs_sb->sb_features_incompat); + feat |= XFS_SB_FEAT_INCOMPAT_META_UUID; + ag_hdr->xfs_sb->sb_features_incompat = cpu_to_be32(feat); + platform_uuid_copy(&ag_hdr->xfs_sb->sb_meta_uuid, +- &ag_hdr->xfs_sb->sb_uuid); ++ &sb->sb_uuid); + } + ++ /* Copy the (possibly new) fs-identifier UUID into sb_uuid */ + platform_uuid_copy(&ag_hdr->xfs_sb->sb_uuid, &tcarg->uuid); + + /* We may have changed the UUID, so update the superblock CRC */ diff --git a/SPECS/xfsprogs.spec b/SPECS/xfsprogs.spec index 8001d99..8875de5 100644 --- a/SPECS/xfsprogs.spec +++ b/SPECS/xfsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing the XFS filesystem Name: xfsprogs Version: 4.5.0 -Release: 9%{?dist} +Release: 10%{?dist} # Licensing based on generic "GNU GENERAL PUBLIC LICENSE" # in source, with no mention of version. # doc/COPYING file specifies what is GPL and what is LGPL @@ -33,6 +33,7 @@ Patch9: xfsprogs-4.7.0-quota-fixes.patch Patch10: xfsprogs-4.8.0-replace-ustat.patch Patch11: xfsprogs-revert-off64_t.patch Patch12: xfsprogs-4.9.0-junk-attr-leaf-count-zero.patch +Patch13: xfsprogs-4.8.0-xfs_copy-UUID.patch %description A set of commands to use the XFS filesystem, including mkfs.xfs. @@ -76,6 +77,7 @@ also want to install xfsprogs. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build export tagname=CC @@ -141,6 +143,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.so %changelog +* Mon May 15 2017 Eric Sandeen 4.5.0-10 +- xfs_copy: Fix meta UUID handling on multiple copies (#1377931, #1450875) + * Fri Dec 16 2016 Eric Sandeen 4.5.0-9 - xfs_repair: junk leaf attribute if count == 0 (#1402944)