bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()
Subsystems (3)
PATCH 1/1 bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper blk_validate_block_size() now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to use sb_set_blocksize() to *verify* that the block size < PAGE_SIZE. The call to sb_set_blocksize() can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem on x86_64, the issue we want to prevent is mounting it on x86_64 unless the filesystem supports LBS.
While, we could argue that such checks should be filesystem specific, there are much more users of sb_set_blocksize() than LBS enabled filesystem on linux-next, so just do the easier thing and bring back the PAGE_SIZE check for sb_set_blocksize() users.
This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your PAGE_SIZE and in the worst case crash.
---
Christian, a small fixup for a crash when running generic/466 on ext4 in a loop. The issue is obvious, and we just need to ensure we don't break old filesystem expectations of sb_set_blocksize().
This still allows XFS with 32k block size and I even tested with XFS with 32k block size and a 32k sector size set.
block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/bdev.c +1 -1
@@ -181,7 +181,7 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { -if (set_blocksize (sb->s_bdev_file, size)) +if (size >PAGE_SIZE ||set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */ sb->s_blocksize = size;
Signature · 1 line
2.47.2
Quoted 15 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.
Quoted 4 lines
This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.
So this is expedient because XFS happens to not call sb_set_blocksize()? What is the path forward for filesystems which call sb_set_blocksize() today and want to support LBS in future?
Quoted 16 lines · Matthew Wilcox
Quoted 15 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.
Quoted 8 lines
Quoted 4 lines
This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.So this is expedient because XFS happens to not call
sb_set_blocksize()? What is the path forward for filesystems which callsb_set_blocksize()today and want to support LBS in future?
Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like XFS does.
Luis: Is the bsize > PAGE_SIZE constraint in set_blocksize go away? IOWs, will xfs support sector sizes > 4k in the near future?
--D
Quoted 39 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.Cc Kent Overstreet <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>---
Christian, a small fixup for a crash when running generic/466 on ext4 in a loop. The issue is obvious, and we just need to ensure we don't break old filesystem expectations of
sb_set_blocksize().This still allows XFS with 32k block size and I even tested with XFS with 32k block size and a 32k sector size set.
block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/bdev.c +0
-0
block/bdev.c EXPORT_SYMBOL(set_blocksize); · line 187
Quoted 8 lines
block/bdev.c +1
-1@@ -181,7 +181,7 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { -if (set_blocksize (sb->s_bdev_file, size)) +if (size >PAGE_SIZE ||set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */ sb->s_blocksize = size;
Can you add a comment stating why it's needed, even with LBS? It's kinda non-obious, and we don't want to repeat the mistake in the future.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Quoted 6 lines · Darrick J. Wong
Quoted 3 lines
So this is expedient because XFS happens to not call
sb_set_blocksize()? What is the path forward for filesystems which callsb_set_blocksize()today and want to support LBS in future?Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like XFS does.
I'm kind of hoping that isn't the answer.
Quoted 2 lines
Luis: Is the bsize >
PAGE_SIZEconstraint inset_blocksizego away? IOWs, will xfs support sector sizes > 4k in the near future?
Already there in linux-next. 47dd67532303 in next-20250304.
Re: [PATCH] bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()'
Quoted 9 lines · Matthew Wilcox
Quoted 6 lines · Darrick J. Wong
Quoted 3 lines
So this is expedient because XFS happens to not call
sb_set_blocksize()? What is the path forward for filesystems which callsb_set_blocksize()today and want to support LBS in future?Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like XFS does.
I'm kind of hoping that isn't the answer.
set_blocksize() can be used. The only extra steps the filesystem needs to in addition is:
sb->s_blocksize = size; sb->s_blocksize_bits = blksize_bits(size);
Which is what both XFS and bcachefs do.
We could modify sb to add an LBS flag but that alone would not suffice either as the upper limit is still a filesystem specific limit. Additionally it also does not suffice for filesystems that support a different device for metadata writes, for instance XFS supports this and uses the sector size for set_blocksize().
So I think that if ext4 for example wants to use LBS then simply it would open code the above two lines and use set_blocksize(). Let me know if you have any other recommendations.
Luis
Quoted 35 lines · Hannes Reinecke
Quoted 34 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.Cc Kent Overstreet <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>---
Christian, a small fixup for a crash when running generic/466 on ext4 in a loop. The issue is obvious, and we just need to ensure we don't break old filesystem expectations of
sb_set_blocksize().This still allows XFS with 32k block size and I even tested with XFS with 32k block size and a 32k sector size set.
block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
block/bdev.c EXPORT_SYMBOL(set_blocksize); · line 186
Quoted 12 lines
block/bdev.c +1
-1@@ -181,7 +181,7 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { -if (set_blocksize (sb->s_bdev_file, size)) +if (size >PAGE_SIZE ||set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */ sb->s_blocksize = size;Can you add a comment stating why it's needed, even with LBS? It's kinda non-obious, and we don't want to repeat the mistake in the future.
Sure.
Luis
Re: [PATCH] bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()'
In reply to Luis ChamberlainQuoted 25 lines · Luis Chamberlain
Quoted 9 lines · Matthew Wilcox
Quoted 6 lines · Darrick J. Wong
Quoted 3 lines
So this is expedient because XFS happens to not call
sb_set_blocksize()? What is the path forward for filesystems which callsb_set_blocksize()today and want to support LBS in future?Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like XFS does.
I'm kind of hoping that isn't the answer.
set_blocksize()can be used. The only extra steps the filesystem needs to in addition is:sb->s_blocksize = size; sb->s_blocksize_bits = blksize_bits(size);Which is what both XFS and bcachefs do.
We could modify sb to add an LBS flag but that alone would not suffice either as the upper limit is still a filesystem specific limit. Additionally it also does not suffice for filesystems that support a different device for metadata writes, for instance XFS supports this and uses the sector size for
set_blocksize().
Quoted 3 lines
So I think that if ext4 for example wants to use LBS then simply it would open code the above two lines and use
set_blocksize(). Let me know if you have any other recommendations.
int sb_set_large_blocksize(struct super_block *sb, int size)
{
if (set_blocksize(sb->s_bdev_file, size))
return 0;
sb->s_blocksize = size;
sb->s_blocksize_bits = blksize_bits(size);
return sb->s_blocksize;
}EXPORT_SYMBOL_GPL(sb_set_large_blocksize);
int sb_set_blocksize(struct super_block *sb, int size)
{
if (size > PAGE_SIZE)
return 0;
return sb_set_large_blocksize(sb, size);
}EXPORT_SYMBOL(sb_set_blocksize);
Though you'll note that this doesn't help XFS, or any other filesystem where the bdev block size isn't set to the fs block size. But xfs can just be weird on its own like always. ;)
--D
Quoted 2 lines
Luis
Re: [PATCH] bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()'
Quoted 46 lines · Darrick J. Wong
Quoted 25 lines · Luis Chamberlain
Quoted 9 lines · Matthew Wilcox
Quoted 6 lines · Darrick J. Wong
Quoted 3 lines
So this is expedient because XFS happens to not call
sb_set_blocksize()? What is the path forward for filesystems which callsb_set_blocksize()today and want to support LBS in future?Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like XFS does.
I'm kind of hoping that isn't the answer.
set_blocksize()can be used. The only extra steps the filesystem needs to in addition is:sb->s_blocksize = size; sb->s_blocksize_bits = blksize_bits(size);Which is what both XFS and bcachefs do.
We could modify sb to add an LBS flag but that alone would not suffice either as the upper limit is still a filesystem specific limit. Additionally it also does not suffice for filesystems that support a different device for metadata writes, for instance XFS supports this and uses the sector size for
set_blocksize().Quoted 3 lines
So I think that if ext4 for example wants to use LBS then simply it would open code the above two lines and use
set_blocksize(). Let me know if you have any other recommendations.int
sb_set_large_blocksize(struct super_block *sb, int size){ if (set_blocksize(sb->s_bdev_file, size)) return 0; sb->s_blocksize = size; sb->s_blocksize_bits = blksize_bits(size); return sb->s_blocksize; }
EXPORT_SYMBOL_GPL(sb_set_large_blocksize);int
sb_set_blocksize(struct super_block *sb, int size){ if (size > PAGE_SIZE) return 0; return sb_set_large_blocksize(sb, size); }
Quoted 5 lines
EXPORT_SYMBOL(sb_set_blocksize);Though you'll note that this doesn't help XFS, or any other filesystem where the bdev block size isn't set to the fs block size. But xfs can just be weird on its own like always. ;)
Actually, I failed to also notice XFS implicitly calls sb_set_large_blocksize() through:
xfs_fs_get_tree() -->
get_tree_bdev() -->
get_tree_bdev_flags() -->
get_tree_bdev_flags() -->
sb_set_blocksize()We just don't care if sb_set_blocksize() if fails inside get_tree_bdev_flags(). To be clear this has been the case since we added and tested LBS on XFS.
So if we wanted something more automatic, how about:
block/bdev.c +2 -0
@@ -181,6 +181,8 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { +if (!(sb->s_type->fs_flags &FS_LBS ) && size >PAGE_SIZE ) +return 0 ;if (set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */
fs/bcachefs/fs.c +1 -1
@@ -2396,7 +2396,7 @@ static struct file_system_type bcache_fs_type = { .name = "bcachefs", .init_fs_context = bch2_init_fs_context, .kill_sb = bch2_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_LBS, };MODULE_ALIAS_FS ("bcachefs" );
fs/xfs/xfs_super.c +2 -1
@@ -2118,7 +2118,8 @@ static struct file_system_type xfs_fs_type = { .init_fs_context = xfs_init_fs_context, .parameters = xfs_fs_parameters, .kill_sb = xfs_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME | + FS_LBS, };MODULE_ALIAS_FS ("xfs" );
include/linux/fs.h +1 -0
@@ -2616,6 +2616,7 @@ struct file_system_type {#define FS_DISALLOW_NOTIFY_PERM 16/* Disable fanotify permission events */ #define FS_ALLOW_IDMAP 32/* FS has been updated to handle vfs idmappings. */ #define FS_MGTIME 64/* FS uses multigrain timestamps */ +#define FS_LBS 128/* FS supports LBS */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters;
Quoted 15 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.
Quoted 7 lines
This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.Cc Kent Overstreet <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>
bcachefs doesn't use sb_set_blocksize() - but it appears it should, and it does also support bs > ps in -next.
Can we get a proper helper for lbs filesystems?
Quoted 28 lines
---
Christian, a small fixup for a crash when running generic/466 on ext4 in a loop. The issue is obvious, and we just need to ensure we don't break old filesystem expectations of
sb_set_blocksize().This still allows XFS with 32k block size and I even tested with XFS with 32k block size and a 32k sector size set.
block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/bdev.c +1
-1@@ -181,7 +181,7 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { -if (set_blocksize (sb->s_bdev_file, size)) +if (size >PAGE_SIZE ||set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */ sb->s_blocksize = size;Signature · 1 line
2.47.2
Quoted 21 lines · Kent Overstreet
Quoted 20 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.
Quoted 7 lines
Quoted 2 lines
Cc Kent Overstreet <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>bcachefs doesn't use
sb_set_blocksize()- but it appears it should, and it does also support bs > ps in -next.Can we get a proper helper for lbs filesystems?
What do you think of this last recommention I had?
block/bdev.c +2 -0
@@ -181,6 +181,8 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { +if (!(sb->s_type->fs_flags &FS_LBS ) && size >PAGE_SIZE ) +return 0 ;if (set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */
fs/bcachefs/fs.c +1 -1
@@ -2396,7 +2396,7 @@ static struct file_system_type bcache_fs_type = { .name = "bcachefs", .init_fs_context = bch2_init_fs_context, .kill_sb = bch2_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_LBS, };MODULE_ALIAS_FS ("bcachefs" );
fs/xfs/xfs_super.c +2 -1
@@ -2118,7 +2118,8 @@ static struct file_system_type xfs_fs_type = { .init_fs_context = xfs_init_fs_context, .parameters = xfs_fs_parameters, .kill_sb = xfs_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME | + FS_LBS, };MODULE_ALIAS_FS ("xfs" );
include/linux/fs.h +1 -0
@@ -2616,6 +2616,7 @@ struct file_system_type {#define FS_DISALLOW_NOTIFY_PERM 16/* Disable fanotify permission events */ #define FS_ALLOW_IDMAP 32/* FS has been updated to handle vfs idmappings. */ #define FS_MGTIME 64/* FS uses multigrain timestamps */ +#define FS_LBS 128/* FS supports LBS */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters;
Quoted 25 lines · Luis Chamberlain
Quoted 24 lines · Kent Overstreet
Quoted 22 lines · Luis Chamberlain
The commit titled "block/bdev: lift block size restrictions to 64k" lifted the block layer's max supported block size to 64k inside the helper
blk_validate_block_size()now that we support large folios. However in lifting the block size we also removed the silly use cases many filesystems have to usesb_set_blocksize()to *verify* that the block size <PAGE_SIZE. The call tosb_set_blocksize()can happen in-kernel given mkfs utilities *can* create for example an ext4 32k block size filesystem onx86_64, the issue we want to prevent is mounting it onx86_64unless the filesystem supports LBS.While, we could argue that such checks should be filesystem specific, there are much more users of
sb_set_blocksize()than LBS enabled filesystem on linux-next, so just do the easier thing and bring back thePAGE_SIZEcheck forsb_set_blocksize()users.This will ensure that tests such as generic/466 when run in a loop against say, ext4, won't try to try to actually mount a filesystem with a block size larger than your filesystem supports given your
PAGE_SIZEand in the worst case crash.Cc Kent Overstreet <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>
Quoted 6 lines
Quoted 4 lines
bcachefs doesn't use
sb_set_blocksize()- but it appears it should, and it does also support bs > ps in -next.Can we get a proper helper for lbs filesystems?
What do you think of this last recommention I had?
Perfect :)
Quoted 53 lines
block/bdev.c +2
-0@@ -181,6 +181,8 @@ EXPORT_SYMBOL(set_blocksize);int sb_set_blocksize (struct super_block *sb,int size) { +if (!(sb->s_type->fs_flags &FS_LBS ) && size >PAGE_SIZE ) +return 0 ;if (set_blocksize (sb->s_bdev_file, size))return 0 ;/* If we get here, we know size is validated */ fs/bcachefs/fs.c +1
-1@@ -2396,7 +2396,7 @@ static struct file_system_type bcache_fs_type = { .name = "bcachefs", .init_fs_context = bch2_init_fs_context, .kill_sb = bch2_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_LBS, };MODULE_ALIAS_FS ("bcachefs" );fs/xfs/xfs_super.c +2
-1@@ -2118,7 +2118,8 @@ static struct file_system_type xfs_fs_type = { .init_fs_context = xfs_init_fs_context, .parameters = xfs_fs_parameters, .kill_sb = xfs_kill_sb, - .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME, + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_MGTIME | + FS_LBS, };MODULE_ALIAS_FS ("xfs" );include/linux/fs.h +1
-0@@ -2616,6 +2616,7 @@ struct file_system_type {#define FS_DISALLOW_NOTIFY_PERM 16/* Disable fanotify permission events */ #define FS_ALLOW_IDMAP 32/* FS has been updated to handle vfs idmappings. */ #define FS_MGTIME 64/* FS uses multigrain timestamps */ +#define FS_LBS 128/* FS supports LBS */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters;