]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: prevent extsize alignment from exceeding maximum extent size
authorDave Chinner <dchinner@redhat.com>
Thu, 27 Jan 2011 01:17:58 +0000 (12:17 +1100)
committerAlex Elder <aelder@sgi.com>
Fri, 28 Jan 2011 15:05:36 +0000 (09:05 -0600)
commit826e507fd817285dac46ee522195579e5b5c49ac
tree8b6351a4d577232c6c3e71c11c6533ce7ff0aa78
parent24057665c2d0f652757fc31e59f9d64f7cf7d725
xfs: prevent extsize alignment from exceeding maximum extent size

When doing delayed allocation, if the allocation size is for a
maximally sized extent, extent size alignment can push it over this
limit. This results in an assert failure in xfs_bmbt_set_allf() as
the extent length is too large to find in the extent record.

Fix this by ensuring that we allow for space that extent size
alignment requires (up to 2 * (extsize -1) blocks as we have to
handle both head and tail alignment) when limiting the maximum size
of the extent.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
fs/xfs/xfs_bmap.c