]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix inode_cluster_size rounding mayhem
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 14 Aug 2019 22:04:55 +0000 (18:04 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 14 Aug 2019 22:04:55 +0000 (18:04 -0400)
commit5fc96f4819ed362dcfa827249d86024cef15f7de
tree787f58e878b839ab462c5864514f511407e6a49b
parent5ee6a39ea14e77096ca31b051ab45f6e475edd02
xfs: fix inode_cluster_size rounding mayhem

Source kernel commit: 490d451fa5188975c21246f7f8f4914cd3f2d6f2

inode_cluster_size is supposed to represent the size (in bytes) of an
inode cluster buffer.  We avoid having to handle multiple clusters per
filesystem block on filesystems with large blocks by openly rounding
this value up to 1 FSB when necessary.  However, we never reset
inode_cluster_size to reflect this new rounded value, which adds to the
potential for mistakes in calculating geometries.

Fix this by setting inode_cluster_size to reflect the rounded-up size if
needed, and special-case the few places in the sparse inodes code where
we actually need the smaller value to validate on-disk metadata.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_format.h
libxfs/xfs_ialloc.c
libxfs/xfs_trans_resv.c