Skip to content

Commit d9fdd0a

Browse files
Brian Fosterdjwong
authored andcommitted
xfs: fix inode number overflow in ifree cluster helper
Qian Cai reports seemingly random buffer read verifier errors during filesystem writeback. This was isolated to a recent patch that factored out some inode cluster freeing code and happened to cast an unsigned inode number type to a signed value. If the inode number value overflows, we can skip marking in-core inodes associated with the underlying buffer stale at the time the physical inodes are freed. If such an inode happens to be dirty, xfsaild will eventually attempt to write it back over non-inode blocks. The invalidation of the underlying inode buffer causes writeback to read the buffer from disk. This fails the read verifier (preventing eventual corruption) if the buffer no longer looks like an inode cluster. Analysis by Dave Chinner. Fix up the helper to use the proper type for inode number values. Fixes: 5806165 ("xfs: factor inode lookup from xfs_ifree_cluster") Reported-by: Qian Cai <[email protected]> Signed-off-by: Brian Foster <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent d8fcb6f commit d9fdd0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,7 @@ static struct xfs_inode *
25112511
xfs_ifree_get_one_inode(
25122512
struct xfs_perag *pag,
25132513
struct xfs_inode *free_ip,
2514-
int inum)
2514+
xfs_ino_t inum)
25152515
{
25162516
struct xfs_mount *mp = pag->pag_mount;
25172517
struct xfs_inode *ip;

0 commit comments

Comments
 (0)