xfs
[Top] [All Lists]

Re: [PATCH] xfs: Check new inode size is OK before preallocating

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: Check new inode size is OK before preallocating
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 21 May 2010 11:03:51 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1274420879-2391-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1274420879-2391-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Fri, May 21, 2010 at 03:47:59PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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@xxxxxx>

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.

<Prev in Thread] Current Thread [Next in Thread>