Export the meta uuid to userspace so that we can restore the original uuid after it has been changed. Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx> --- fs/xfs/libxfs/xfs_fs.h | 3 ++- fs/xfs/libxfs/xfs_sb.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index a350966cce99..d88adaf9369f 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -186,7 +186,8 @@ struct xfs_fsop_geom { __u32 logsunit; /* log stripe unit, bytes */ uint32_t sick; /* o: unhealthy fs & rt metadata */ uint32_t checked; /* o: checked fs & rt metadata */ - __u64 reserved[17]; /* reserved space */ + unsigned char metauuid[16]; /* metadata id of the filesystem*/ + __u64 reserved[15]; /* reserved space */ }; #define XFS_FSOP_GEOM_SICK_COUNTERS (1 << 0) /* summary counters */ diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 99cc03a298e2..4c24f3314122 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -1213,6 +1213,11 @@ xfs_fs_geometry( return; geo->version = XFS_FSOP_GEOM_VERSION_V5; + + if (xfs_has_metauuid(mp)) { + BUILD_BUG_ON(sizeof(geo->metauuid) != sizeof(sbp->sb_meta_uuid)); + memcpy(geo->metauuid, &sbp->sb_meta_uuid, sizeof(sbp->sb_meta_uuid)); + } } /* Read a secondary superblock. */ -- 2.34.1