• Dave Chinner's avatar
    xfs: Check new inode size is OK before preallocating · 07f1a4f5
    Dave Chinner authored
    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.
    
    (Fixed a reference to "newsize" to read "new_size". -Alex)
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
    07f1a4f5
xfs_vnodeops.c 74.3 KB