mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
xfs: check the return value of sb_min_blocksize() in xfs_fs_fill_super
commit124af0868eupstream. sb_min_blocksize() may return 0. Check its return value to avoid the filesystem super block when sb->s_blocksize is 0. Cc: stable@vger.kernel.org # v6.15 Fixes:a64e5a5960("bdev: add back PAGE_SIZE block size validation for sb_set_blocksize()") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Link: https://patch.msgid.link/20251104125009.2111925-5-yangyongpeng.storage@gmail.com Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
37944f4f81
commit
deb220e589
@@ -1710,7 +1710,10 @@ xfs_fs_fill_super(
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
sb_min_blocksize(sb, BBSIZE);
|
||||
if (!sb_min_blocksize(sb, BBSIZE)) {
|
||||
xfs_err(mp, "unable to set blocksize");
|
||||
return -EINVAL;
|
||||
}
|
||||
sb->s_xattr = xfs_xattr_handlers;
|
||||
sb->s_export_op = &xfs_export_operations;
|
||||
#ifdef CONFIG_XFS_QUOTA
|
||||
|
||||
Reference in New Issue
Block a user