From 58590cb2ef48c6e85a8afeda01c385efc8c693bc Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 26 Jul 2016 20:29:26 +0300 Subject: [PATCH] xfs: accept filesystem with meta_uuid XFS V5 stores UUID in metadata and compares them with superblock UUID. To allow changing of user-visible UUID it stores original value in new superblock field (meta_uuid) and sets incompatible flag to indicate that new field must be used to verify metadata. Our driver currently does not check metadata UUID so simply accept such filesystem. Reported-By: Marcos Mello Reviewd by Jan Kara --- grub-core/fs/xfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index ca9c0c37a..9f66dd6e4 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -76,8 +76,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); /* incompat feature flags */ #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ +#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ +#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ + +/* We do not currently verify metadata UUID so it is safe to read such filesystem */ #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ - (XFS_SB_FEAT_INCOMPAT_FTYPE) + (XFS_SB_FEAT_INCOMPAT_FTYPE | \ + XFS_SB_FEAT_INCOMPAT_META_UUID) struct grub_xfs_sblock {