Skip to contentSkip to conversation

fs/xfs: add new superblock features added in Linux 6.12/6.13

PATCH In review Darrick J. Wong via Grub-devel 2 participants 3 messages Feb 3, 2025 – Feb 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/xfs: add new superblock features added in Linux 6.12/6.13

From: Darrick J. Wong <[email protected]>

The Linux port of XFS added a few new features in 2024. The existing grub driver doesn't attempt to read or write any of the new metadata, so all three can be added to the incompat allowlist.

---
 grub-core/fs/xfs.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
grub-core/fs/xfs.c +16 -1
index 8e02ab4a301424..5d809a770a1576 100644
@@ -89,6 +89,9 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #define XFS_SB_FEAT_INCOMPAT_BIGTIME    (1 << 3)        /* large timestamps */
 #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4)       /* needs xfs_repair */
 #define XFS_SB_FEAT_INCOMPAT_NREXT64 (1 << 5)           /* large extent counters */
+#define XFS_SB_FEAT_INCOMPAT_EXCHRANGE  (1 << 6)        /* exchangerange supported */
+#define XFS_SB_FEAT_INCOMPAT_PARENT     (1 << 7)        /* parent pointers */
+#define XFS_SB_FEAT_INCOMPAT_METADIR    (1 << 8)        /* metadata dir tree */
 
 /*
  * Directory entries with ftype are explicitly handled by GRUB code.
@@ -98,6 +101,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
  *
  * We do not currently verify metadata UUID, so it is safe to read filesystems
  * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
+ *
+ * We do not currently replay the log, so it is safe to read filesystems
+ * with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.
+ *
+ * We do not currently read directory parent pointers, so it is safe to read
+ * filesystems with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.
+ *
+ * We do not currently look at realtime or quota metadata, so it is safe to
+ * read filesystems with the XFS_SB_FEAT_INCOMPAT_METADIR feature.
  */
 #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
 	(XFS_SB_FEAT_INCOMPAT_FTYPE | \
@@ -105,7 +117,10 @@ GRUB_MOD_LICENSE ("GPLv3+");
 	 XFS_SB_FEAT_INCOMPAT_META_UUID | \
 	 XFS_SB_FEAT_INCOMPAT_BIGTIME | \
 	 XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR | \
-	 XFS_SB_FEAT_INCOMPAT_NREXT64)
+	 XFS_SB_FEAT_INCOMPAT_NREXT64 | \
+	 XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
+	 XFS_SB_FEAT_INCOMPAT_PARENT | \
+	 XFS_SB_FEAT_INCOMPAT_METADIR)
 
 struct grub_xfs_sblock
 {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Darrick J. Wong via Grub-devel

From: Darrick J. Wong <[email protected]>

The Linux port of XFS added a few new features in 2024. The existing grub driver doesn't attempt to read or write any of the new metadata, so all three can be added to the incompat allowlist.

... but one nit below...

Quoted 19 lines
---
 grub-core/fs/xfs.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
grub-core/fs/xfs.c +3 -0
index 8e02ab4a301424..5d809a770a1576 100644
@@ -89,6 +89,9 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #define XFS_SB_FEAT_INCOMPAT_BIGTIME    (1 << 3)        /* large timestamps */
 #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4)       /* needs xfs_repair */
 #define XFS_SB_FEAT_INCOMPAT_NREXT64 (1 << 5)           /* large extent counters */
+#define XFS_SB_FEAT_INCOMPAT_EXCHRANGE  (1 << 6)        /* exchangerange supported */
+#define XFS_SB_FEAT_INCOMPAT_PARENT     (1 << 7)        /* parent pointers */
+#define XFS_SB_FEAT_INCOMPAT_METADIR    (1 << 8)        /* metadata dir tree */
 
 /*
  * Directory entries with ftype are explicitly handled by GRUB code.

grub-core/fs/xfs.c GRUB_MOD_LICENSE ("GPLv3+"); · line 109

Quoted 9 lines
grub-core/fs/xfs.c +6 -0
@@ -98,6 +101,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
  *
  * We do not currently verify metadata UUID, so it is safe to read filesystems
  * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
+ *
+ * We do not currently replay the log, so it is safe to read filesystems
+ * with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.
+ *
+ * We do not currently read directory parent pointers, so it is safe to read
+ * filesystems with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.

s/XFS_SB_FEAT_INCOMPAT_EXCHRANGE/XFS_SB_FEAT_INCOMPAT_PARENT/?

I can fix it for you before push...

Quoted 7 lines
grub-core/fs/xfs.c +3 -0
+ *
+ * We do not currently look at realtime or quota metadata, so it is safe to
+ * read filesystems with the XFS_SB_FEAT_INCOMPAT_METADIR feature.
  */
 #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
 	(XFS_SB_FEAT_INCOMPAT_FTYPE | \

grub-core/fs/xfs.c GRUB_MOD_LICENSE ("GPLv3+"); · line 123

Quoted 8 lines
grub-core/fs/xfs.c +4 -1
@@ -105,7 +117,10 @@ GRUB_MOD_LICENSE ("GPLv3+");
 	 XFS_SB_FEAT_INCOMPAT_META_UUID | \
 	 XFS_SB_FEAT_INCOMPAT_BIGTIME | \
 	 XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR | \
-	 XFS_SB_FEAT_INCOMPAT_NREXT64)
+	 XFS_SB_FEAT_INCOMPAT_NREXT64 | \
+	 XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
+	 XFS_SB_FEAT_INCOMPAT_PARENT | \
+	 XFS_SB_FEAT_INCOMPAT_METADIR)

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 44 lines · Daniel Kiper
Quoted 7 lines · Darrick J. Wong via Grub-devel

From: Darrick J. Wong <[email protected]>

The Linux port of XFS added a few new features in 2024. The existing grub driver doesn't attempt to read or write any of the new metadata, so all three can be added to the incompat allowlist.

... but one nit below...

Quoted 19 lines
---
 grub-core/fs/xfs.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
grub-core/fs/xfs.c +3 -0
index 8e02ab4a301424..5d809a770a1576 100644
@@ -89,6 +89,9 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #define XFS_SB_FEAT_INCOMPAT_BIGTIME    (1 << 3)        /* large timestamps */
 #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4)       /* needs xfs_repair */
 #define XFS_SB_FEAT_INCOMPAT_NREXT64 (1 << 5)           /* large extent counters */
+#define XFS_SB_FEAT_INCOMPAT_EXCHRANGE  (1 << 6)        /* exchangerange supported */
+#define XFS_SB_FEAT_INCOMPAT_PARENT     (1 << 7)        /* parent pointers */
+#define XFS_SB_FEAT_INCOMPAT_METADIR    (1 << 8)        /* metadata dir tree */
 
 /*
  * Directory entries with ftype are explicitly handled by GRUB code.

grub-core/fs/xfs.c GRUB_MOD_LICENSE ("GPLv3+"); · line 109

Quoted 9 lines
grub-core/fs/xfs.c +6 -0
@@ -98,6 +101,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
  *
  * We do not currently verify metadata UUID, so it is safe to read filesystems
  * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
+ *
+ * We do not currently replay the log, so it is safe to read filesystems
+ * with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.
+ *
+ * We do not currently read directory parent pointers, so it is safe to read
+ * filesystems with the XFS_SB_FEAT_INCOMPAT_EXCHRANGE feature.

s/XFS_SB_FEAT_INCOMPAT_EXCHRANGE/XFS_SB_FEAT_INCOMPAT_PARENT/?

Quoted 1 line

I can fix it for you before push...

Oops, yes, that's correct. Apologies for the copypasta. :/

Thanks for reviewing!

--D

Quoted 17 lines
Quoted 7 lines
grub-core/fs/xfs.c +3 -0
+ *
+ * We do not currently look at realtime or quota metadata, so it is safe to
+ * read filesystems with the XFS_SB_FEAT_INCOMPAT_METADIR feature.
  */
 #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
 	(XFS_SB_FEAT_INCOMPAT_FTYPE | \

grub-core/fs/xfs.c GRUB_MOD_LICENSE ("GPLv3+"); · line 123

Quoted 8 lines
grub-core/fs/xfs.c +4 -1
@@ -105,7 +117,10 @@ GRUB_MOD_LICENSE ("GPLv3+");
 	 XFS_SB_FEAT_INCOMPAT_META_UUID | \
 	 XFS_SB_FEAT_INCOMPAT_BIGTIME | \
 	 XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR | \
-	 XFS_SB_FEAT_INCOMPAT_NREXT64)
+	 XFS_SB_FEAT_INCOMPAT_NREXT64 | \
+	 XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
+	 XFS_SB_FEAT_INCOMPAT_PARENT | \
+	 XFS_SB_FEAT_INCOMPAT_METADIR)

Daniel