]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
Btrfs: fill the global reserve when unpinning space
authorJosef Bacik <jbacik@fusionio.com>
Mon, 22 Oct 2012 19:52:28 +0000 (15:52 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Tue, 11 Dec 2012 18:31:36 +0000 (13:31 -0500)
commit7b398f8e58c415738e397645c926253c428cf002
tree4fb8237c474e2e86b4275b196993f7fd757df09e
parent32adf0901371c8b9d258dba7811f3067d1d2ea5c
Btrfs: fill the global reserve when unpinning space

Dave gave me an image of a very full file system that would abort the
transaction because it ran out of space while committing the transaction.
This is because we would think there was plenty of room to create a snapshot
even though the global reserve was not full.  This happens because we
calculate the global reserve size before we unpin any space, so after we
unpin the space we allow reservations to occur even though we haven't
reserved all of the space for our global reserve.  Fix this by adding to the
global reserve while unpinning in order to make sure we always have enough
space to do our work.  With this patch we no longer end up with an aborted
transaction, we return ENOSPC properly to the person trying to create the
snapshot.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/extent-tree.c