mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
xfs: complain if we don't get nextents bmap records
commit 356a322522 upstream.
When reading into memory all extents of a btree-format inode fork,
complain if the number of extents we find is not the same as the number
of extents reported in the inode core. This is needed to stop an IO
action from accessing the garbage areas of the in-core fork.
[dchinner: removed redundant assert]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4bb31bccea
commit
b88398de18
@@ -1377,8 +1377,9 @@ xfs_bmap_read_extents(
|
||||
return error;
|
||||
block = XFS_BUF_TO_BLOCK(bp);
|
||||
}
|
||||
if (i != XFS_IFORK_NEXTENTS(ip, whichfork))
|
||||
return -EFSCORRUPTED;
|
||||
ASSERT(i == xfs_iext_count(ifp));
|
||||
ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork));
|
||||
XFS_BMAP_TRACE_EXLIST(ip, i, whichfork);
|
||||
return 0;
|
||||
error0:
|
||||
|
||||
Reference in New Issue
Block a user