Skip to content

Commit

Permalink
[XFS] Allow punching holes to free space when at ENOSPC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Chinner authored and Tim Shimmin committed Jul 19, 2007
1 parent 4f57dbc commit 91ebecc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -4434,9 +4434,12 @@ xfs_free_file_space(
while (!error && !done) {

/*
* allocate and setup the transaction
* allocate and setup the transaction. Allow this
* transaction to dip into the reserve blocks to ensure
* the freeing of the space succeeds at ENOSPC.
*/
tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
tp->t_flags |= XFS_TRANS_RESERVE;
error = xfs_trans_reserve(tp,
resblks,
XFS_WRITE_LOG_RES(mp),
Expand Down

0 comments on commit 91ebecc

Please sign in to comment.