]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: don't allow insert-range to shift extents past the maximum offset
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
commit5b5015975b93ff50e042217e2e51614780ebcb87
tree1bf4eeccb1ee03d9a851dec61c14579fdd01c333
parent8ac50bafe965954ed35f08418b625964150c2851
xfs: don't allow insert-range to shift extents past the maximum offset

Source kernel commit: f62cb48e43195f66c7a40bbfcf11531fc1ff8999

Zorro Lang reports that generic/485 blows an assert on a filesystem with
512 byte blocks.  The test tries to fallocate a post-eof extent at the
maximum file size and calls insert range to shift the extents right by
two blocks.  On a 512b block filesystem this causes startoff to overflow
the 54-bit startoff field, leading to the assert.

Therefore, always check the rightmost extent to see if it would overflow
prior to invoking the insert range machinery.

Reported-by: zlang@redhat.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200137
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h
libxfs/xfs_format.h