diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-05-08 20:48:53 +1000 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-05-21 10:45:43 -0500 |
commit | ea562ed6e7df5acd9392d993882c39e855099165 (patch) | |
tree | 0f91e73ae2adba9e0469a7a87abe44c13a880c70 /fs/xfs/xfs_iomap.c | |
parent | 1307bbd2af67283131728637e9489002adb26f10 (diff) | |
download | lwn-ea562ed6e7df5acd9392d993882c39e855099165.tar.gz lwn-ea562ed6e7df5acd9392d993882c39e855099165.zip |
xfs: fix delalloc quota accounting on failure
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: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 69c6e251c012..aadfce6681ee 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -246,7 +246,7 @@ out_unlock: out_bmap_cancel: xfs_bmap_cancel(&free_list); - xfs_trans_unreserve_quota_nblks(tp, ip, qblocks, 0, quota_flag); + xfs_trans_unreserve_quota_nblks(tp, ip, (long)qblocks, 0, quota_flag); out_trans_cancel: xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); goto out_unlock; |