]>
Commit | Line | Data |
---|---|---|
848ac690 SS |
1 | From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001 |
2 | From: Daniel Kiper <daniel.kiper@oracle.com> | |
3 | Date: Tue, 29 May 2018 16:16:02 +0200 | |
4 | Subject: xfs: Accept filesystem with sparse inodes | |
5 | ||
6 | The sparse inode metadata format became a mkfs.xfs default in | |
7 | xfsprogs-4.16.0, and such filesystems are now rejected by grub as | |
8 | containing an incompatible feature. | |
9 | ||
10 | In essence, this feature allows xfs to allocate inodes into fragmented | |
11 | freespace. (Without this feature, if xfs could not allocate contiguous | |
12 | space for 64 new inodes, inode creation would fail.) | |
13 | ||
14 | In practice, the disk format change is restricted to the inode btree, | |
15 | which as far as I can tell is not used by grub. If all you're doing | |
16 | today is parsing a directory, reading an inode number, and converting | |
17 | that inode number to a disk location, then ignoring this feature | |
18 | should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED | |
19 | ||
20 | I did some brief testing of this patch by hacking up the regression | |
21 | tests to completely fragment freespace on the test xfs filesystem, and | |
22 | then write a large-ish number of inodes to consume any existing | |
23 | contiguous 64-inode chunk. This way any files the grub tests add and | |
24 | traverse would be in such a fragmented inode allocation. Tests passed, | |
25 | but I'm not sure how to cleanly integrate that into the test harness. | |
26 | ||
27 | Signed-off-by: Eric Sandeen <sandeen@redhat.com> | |
28 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | |
29 | Tested-by: Chris Murphy <lists@colorremedies.com> | |
30 | --- | |
31 | grub-core/fs/xfs.c | 11 ++++++++++- | |
32 | 1 file changed, 10 insertions(+), 1 deletion(-) | |
33 | ||
34 | diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c | |
35 | index c6031bd..3b00c74 100644 | |
36 | --- a/grub-core/fs/xfs.c | |
37 | +++ b/grub-core/fs/xfs.c | |
38 | @@ -79,9 +79,18 @@ GRUB_MOD_LICENSE ("GPLv3+"); | |
39 | #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ | |
40 | #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ | |
41 | ||
42 | -/* We do not currently verify metadata UUID so it is safe to read such filesystem */ | |
43 | +/* | |
44 | + * Directory entries with ftype are explicitly handled by GRUB code. | |
45 | + * | |
46 | + * We do not currently read the inode btrees, so it is safe to read filesystems | |
47 | + * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature. | |
48 | + * | |
49 | + * We do not currently verify metadata UUID, so it is safe to read filesystems | |
50 | + * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature. | |
51 | + */ | |
52 | #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ | |
53 | (XFS_SB_FEAT_INCOMPAT_FTYPE | \ | |
54 | + XFS_SB_FEAT_INCOMPAT_SPINODES | \ | |
55 | XFS_SB_FEAT_INCOMPAT_META_UUID) | |
56 | ||
57 | struct grub_xfs_sblock | |
58 | -- | |
59 | cgit v1.0-41-gc330 | |
60 |