Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 525682 - sys-boot/grub: Add support for XFS filesystems with a v5 superblock
Summary: sys-boot/grub: Add support for XFS filesystems with a v5 superblock
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL: https://lists.gnu.org/archive/html/gr...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-17 19:43 UTC by kfm
Modified: 2015-02-01 18:44 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
GRUB XFS v5 patch 1/4 (0001-xfs-Add-helper-for-inode-size.patch,2.54 KB, patch)
2014-10-17 19:45 UTC, kfm
Details | Diff
GRUB XFS v5 patch 2/4 (0002-xfs-Fix-termination-loop-for-directory-iteration.patch,1.11 KB, patch)
2014-10-17 19:46 UTC, kfm
Details | Diff
GRUB XFS v5 patch 3/4 (0003-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch,2.77 KB, patch)
2014-10-17 19:46 UTC, kfm
Details | Diff
GRUB XFS v5 patch 4/4 (0004-xfs-V5-filesystem-format-support.patch,15.22 KB, patch)
2014-10-17 19:47 UTC, kfm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kfm 2014-10-17 19:43:23 UTC
With Linux 3.10, XFS acquired the capability of protecting metadata structures with CRC checksums.

https://github.com/torvalds/linux/blob/master/Documentation/filesystems/xfs-self-describing-metadata.txt

As of Linux 3.15, this capability is officially considered to be safe for production workloads. As such, mounting an XFS filesystem with a v5 superblock will no longer trigger a warning that it is experimental.

To create such a filesystem, >=xfsprogs-3.2 is required. Bug 524734 is currently being processed for stabilization.

One issue that remains is that grub2 is not able to handle XFS v5. Jan Kara (of SuSE) has contributed patches that rectify this issue. I have tested these patches and they work perfectly. Unfortunately, upstream continue to drag their heels on this matter.

Therefore, I would like for these patches to be applied by the ebuild so that XFS v5 can assume its rightful place as a first-class citizen in Gentoo. These patches are attached herewith.
Comment 1 kfm 2014-10-17 19:45:26 UTC
Created attachment 386810 [details, diff]
GRUB XFS v5 patch 1/4
Comment 2 kfm 2014-10-17 19:46:05 UTC
Created attachment 386812 [details, diff]
GRUB XFS v5 patch 2/4
Comment 3 kfm 2014-10-17 19:46:57 UTC
Created attachment 386814 [details, diff]
GRUB XFS v5 patch 3/4
Comment 4 Mike Gilbert gentoo-dev 2014-10-17 19:47:26 UTC
The patches only affect grub-core/fs/xfs.c, so the risk seems pretty low here. I'll consider it.
Comment 5 kfm 2014-10-17 19:47:34 UTC
Created attachment 386816 [details, diff]
GRUB XFS v5 patch 4/4
Comment 6 kfm 2014-10-17 19:48:32 UTC
Original patch names are as follows:

0001-xfs-Add-helper-for-inode-size.patch
0002-xfs-Fix-termination-loop-for-directory-iteration.patch
0003-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch
0004-xfs-V5-filesystem-format-support.patch
Comment 7 kfm 2014-10-17 19:50:03 UTC
Type in the first comment: Bug 524374 is actually the one that concerns xfsprogs.
Comment 8 kfm 2014-10-17 23:26:28 UTC
(In reply to Mike Gilbert from comment #4)
> The patches only affect grub-core/fs/xfs.c, so the risk seems pretty low
> here. I'll consider it.

Very good. Incidentally, I've just tested a patched grub against a non-v5 filesystem and it continues to work.
Comment 9 Mike Gilbert gentoo-dev 2014-11-01 16:16:01 UTC
Is there a git repo I can pull this from? That would help me in maintaining it.
Comment 10 kfm 2015-01-21 01:02:18 UTC
(In reply to Mike Gilbert from comment #9)
> Is there a git repo I can pull this from? That would help me in maintaining
> it.

I don't think so. Jan posted the patches to grub-devel, someone promised to look over them but nothing seems to have come of it yet. I had trouble extracting the patches from the list archive so I contacted Jan, who simply mailed them to me. He is responsive so you could mail him if you have any questions.
Comment 11 Vint 2015-02-01 12:13:38 UTC
Having put those patches in my _user_patch_dir_ for months, nothing wrong happened. I have every partition in my Gentoo box formatted to XFS v5.

It seems Suse guy made those patches, and so far no other distribution has merged them, neither upstream grub. 

As to XFS, there are arguments against superblock v5, larger inode size and metadata CRC overhead...etc. Despite that, the future is v5.

I'd also like those patches to be applied by Gentoo. Just like when Gentoo is the spearhead distribution to support XFS.
Comment 12 Mike Gilbert gentoo-dev 2015-02-01 18:44:34 UTC
+*grub-2.02_beta2-r7 (01 Feb 2015)
+
+  01 Feb 2015; Mike Gilbert <floppym@gentoo.org> +grub-2.02_beta2-r7.ebuild:
+  Add patches for XFS v5 superblocks, bug 525682. Fix build on musl, bug 529356.