]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix enospc problems when deleting a subvol
authorJosef Bacik <jbacik@fusionio.com>
Wed, 8 Aug 2012 16:12:59 +0000 (10:12 -0600)
committerChris Mason <chris.mason@oracle.com>
Tue, 28 Aug 2012 20:53:37 +0000 (16:53 -0400)
commit327ebfe6d9da7a0a7753b136d49291615b071d48
tree01fbac2ecd8fa4224c97c16ce216bc003b4cd60f
parentdf9d4b34a88dff7b45bcf2ebdf7090aa5985325e
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>
fs/btrfs/inode.c