• Dave Chinner's avatar
    xfs: fix delalloc quota accounting on failure · ea562ed6
    Dave Chinner authored
    xfstest 270 was causing quota reservations way beyond what was sane
    (ten to hundreds of TB) for a 4GB filesystem. There's a sign problem
    in the error handling path of xfs_bmapi_reserve_delalloc() because
    xfs_trans_unreserve_quota_nblks() simple negates the value passed -
    which doesn't work for an unsigned variable. This causes
    reservations of close to 2^32 block instead of removing a
    reservation of a handful of blocks.
    
    Fix the same problem in the other xfs_trans_unreserve_quota_nblks()
    callers where unsigned integer variables are used, too.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    ea562ed6
xfs_vnodeops.c 57.9 KB