[PATCH] xfs: Check new inode size is OK before preallocating
Christoph Hellwig
hch at infradead.org
Fri May 21 10:03:51 CDT 2010
On Fri, May 21, 2010 at 03:47:59PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
>
> The new xfsqa test 228 tries to preallocate more space than the
> filesystem contains. it should fail, but instead triggers an assert
> about lock flags. The failure is due to the size extension failing
> in vmtruncate() due to rlimit being set. Check this before we start
> the preallocation to avoid allocating space that will never be used.
>
> Also the path through xfs_vn_allocate already holds the IO lock, so
> it should not be present in the lock flags when the setattr fails.
> Hence the assert needs to take this into account. This will prevent
> other such callers from hitting this incorrect ASSERT.
Looks good,
Reviewed-by: Christoph Hellwig <hch at lst.de>
Can you also add a check to 228 to ensure the space doesn't stay
allocate when the test fails, to catch the old XFS behaviour.
More information about the xfs
mailing list