summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_sb.c
diff options
context:
space:
mode:
authorDave Chinner2015-07-29 03:54:21 +0200
committerDave Chinner2015-07-29 03:54:21 +0200
commit5461ad99cab98d19f2570c468cdd6c42b6d66795 (patch)
tree7050a1529a6da548bc17d93c866e5a4ddd167f48 /fs/xfs/libxfs/xfs_sb.c
parentMerge branch 'xfs-misc-fixes-for-4.3' into for-next (diff)
parentxfs: create new metadata UUID field and incompat flag (diff)
downloadkernel-qcow2-linux-5461ad99cab98d19f2570c468cdd6c42b6d66795.tar.gz
kernel-qcow2-linux-5461ad99cab98d19f2570c468cdd6c42b6d66795.tar.xz
kernel-qcow2-linux-5461ad99cab98d19f2570c468cdd6c42b6d66795.zip
Merge branch 'xfs-meta-uuid' into for-next
Diffstat (limited to 'fs/xfs/libxfs/xfs_sb.c')
-rw-r--r--fs/xfs/libxfs/xfs_sb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index a3f4504b1f1e..21009dbdc21d 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -402,6 +402,14 @@ __xfs_sb_from_disk(
to->sb_spino_align = be32_to_cpu(from->sb_spino_align);
to->sb_pquotino = be64_to_cpu(from->sb_pquotino);
to->sb_lsn = be64_to_cpu(from->sb_lsn);
+ /*
+ * sb_meta_uuid is only on disk if it differs from sb_uuid and the
+ * feature flag is set; if not set we keep it only in memory.
+ */
+ if (xfs_sb_version_hasmetauuid(to))
+ uuid_copy(&to->sb_meta_uuid, &from->sb_meta_uuid);
+ else
+ uuid_copy(&to->sb_meta_uuid, &from->sb_uuid);
/* Convert on-disk flags to in-memory flags? */
if (convert_xquota)
xfs_sb_quota_from_disk(to);
@@ -543,6 +551,8 @@ xfs_sb_to_disk(
cpu_to_be32(from->sb_features_log_incompat);
to->sb_spino_align = cpu_to_be32(from->sb_spino_align);
to->sb_lsn = cpu_to_be64(from->sb_lsn);
+ if (xfs_sb_version_hasmetauuid(from))
+ uuid_copy(&to->sb_meta_uuid, &from->sb_meta_uuid);
}
}