diff options
author | David Chinner <dgc@sgi.com> | 2007-07-19 02:28:30 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-19 05:51:46 -0400 |
commit | 91ebecc74eeeeea0a2aa50bf1964ec2214a229c9 (patch) | |
tree | a81a48c59c46c7fedce5532afb6fd2ce648201dd | |
parent | 4f57dbc6b5bae5a3978d429f45ac597ca7a3b8c6 (diff) |
[XFS] Allow punching holes to free space when at ENOSPC
Make the free file space transaction able to dip into the reserved blocks
to ensure that we can successfully free blocks when the filesystem is at
ENOSPC.
SGI-PV: 967788
SGI-Modid: xfs-linux-melb:xfs-kern:29167a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Vlad Apostolov <vapo@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 79b522779aa4..401cb00a55d6 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -4434,9 +4434,12 @@ xfs_free_file_space( | |||
4434 | while (!error && !done) { | 4434 | while (!error && !done) { |
4435 | 4435 | ||
4436 | /* | 4436 | /* |
4437 | * allocate and setup the transaction | 4437 | * allocate and setup the transaction. Allow this |
4438 | * transaction to dip into the reserve blocks to ensure | ||
4439 | * the freeing of the space succeeds at ENOSPC. | ||
4438 | */ | 4440 | */ |
4439 | tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); | 4441 | tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); |
4442 | tp->t_flags |= XFS_TRANS_RESERVE; | ||
4440 | error = xfs_trans_reserve(tp, | 4443 | error = xfs_trans_reserve(tp, |
4441 | resblks, | 4444 | resblks, |
4442 | XFS_WRITE_LOG_RES(mp), | 4445 | XFS_WRITE_LOG_RES(mp), |