aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2012-08-08 12:12:59 -0400
committerChris Mason <chris.mason@oracle.com>2012-08-28 16:53:37 -0400
commit5a24e84c55f57cc49bd1cab531b6ef28b6b7bdaa (patch)
tree01fbac2ecd8fa4224c97c16ce216bc003b4cd60f
parentc0f62dedd04ae0f3b8a18079db5a015af24e416f (diff)
Btrfs: fix enospc problems when deleting a subvol
Subvol delete is a special kind of awful where we use the global reserve to cover the ENOSPC requirements. The problem is once we're done removing everything we do a btrfs_update_inode(), which by default will try to do the delayed update stuff which will use it's own reserve. There will be no space in this reserve and we'll return ENOSPC. So instead use btrfs_update_inode_fallback() which will just fallback to updating the inode item in the case of enospc. This is fine because the global reserve covers the space requirements for this. With this patch I can now delete a subvol on a problem image Dave Sterba sent me. Thanks, Reported-by: David Sterba <dave@jikos.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 97baf00b40d1..0808f483dafa 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3171,7 +3171,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
3171 btrfs_i_size_write(dir, dir->i_size - name_len * 2); 3171 btrfs_i_size_write(dir, dir->i_size - name_len * 2);
3172 inode_inc_iversion(dir); 3172 inode_inc_iversion(dir);
3173 dir->i_mtime = dir->i_ctime = CURRENT_TIME; 3173 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
3174 ret = btrfs_update_inode(trans, root, dir); 3174 ret = btrfs_update_inode_fallback(trans, root, dir);
3175 if (ret) 3175 if (ret)
3176 btrfs_abort_transaction(trans, root, ret); 3176 btrfs_abort_transaction(trans, root, ret);
3177out: 3177out: