[packages/grub2] - rel 3; support xfs filesystems made with sparse inodes enabled (default for mkfs.xfs 4.16+)

arekm arekm at pld-linux.org
Wed May 16 19:54:57 CEST 2018


commit d6c673cedd1b33f9155c7807fd19d5f87865a76f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed May 16 19:54:50 2018 +0200

    - rel 3; support xfs filesystems made with sparse inodes enabled (default for mkfs.xfs 4.16+)

 grub2.spec |  4 +++-
 xfs.patch  | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/grub2.spec b/grub2.spec
index 007bf58..22c1155 100644
--- a/grub2.spec
+++ b/grub2.spec
@@ -47,7 +47,7 @@ Summary(pl.UTF-8):	GRUB2 - bootloader dla x86 i ppc
 Summary(pt_BR.UTF-8):	Gerenciador de inicialização GRUB2
 Name:		grub2
 Version:	2.02
-Release:	2
+Release:	3
 License:	GPL v2
 Group:		Base
 Source0:	ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
@@ -72,6 +72,7 @@ Patch13:	efi-net-fix.patch
 Patch14:	blscfg.patch
 # https://git.archlinux.org/svntogit/packages.git/plain/trunk/0002-intel-ucode.patch?h=packages/grub
 Patch15:	intel-ucode.patch
+Patch16:	xfs.patch
 URL:		http://www.gnu.org/software/grub/
 BuildRequires:	autoconf >= 2.53
 BuildRequires:	automake >= 1:1.11.1-1
@@ -301,6 +302,7 @@ Motyw starfield dla GRUB-a.
 %patch13 -p1
 %patch14 -p1
 %patch15 -p1
+%patch16 -p1
 
 # we don't have C.utf-8 and need an UTF-8 locale for build
 sed -i -e 's/LC_ALL=C.UTF-8/LC_ALL=en_US.utf-8/g' po/Makefile* po/Rules*
diff --git a/xfs.patch b/xfs.patch
new file mode 100644
index 0000000..6ffd2b5
--- /dev/null
+++ b/xfs.patch
@@ -0,0 +1,37 @@
+The sparse inode metadata format became a mkfs.xfs default in
+xfsprogs-4.16.0, and such filesystems are now rejected by grub as
+containing an incompatible feature.
+
+In essence, this feature allows xfs to allocate inodes into fragmented
+freespace.  (Without this feature, if xfs could not allocate contiguous
+space for 64 new inodes, inode creation would fail.)
+
+In practice, the disk format change is restricted to the inode btree,
+which as far as I can tell is not used by grub.  If all you're doing
+today is parsing a directory, reading an inode number, and converting
+that inode number to a disk location, then ignoring this feature
+should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED
+
+I did some brief testing of this patch by hacking up the regression
+tests to completely fragment freespace on the test xfs filesystem, and
+then write a large-ish number of inodes to consume any existing
+contiguous 64-inode chunk.  This way any files the grub tests add and
+traverse would be in such a fragmented inode allocation.  Tests passed,
+but I'm not sure how to cleanly integrate that into the test harness.
+
+Signed-off-by: Eric Sandeen <sandeen at redhat.com>
+---
+
+diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
+index c6031bd3f..effe9de17 100644
+--- a/grub-core/fs/xfs.c
++++ b/grub-core/fs/xfs.c
+@@ -82,6 +82,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
+ /* 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_SPINODES | \
+ 	 XFS_SB_FEAT_INCOMPAT_META_UUID)
+ 
+ struct grub_xfs_sblock
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/grub2.git/commitdiff/d6c673cedd1b33f9155c7807fd19d5f87865a76f



More information about the pld-cvs-commit mailing list