]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: simplify unlink reservations
authorJosef Bacik <jbacik@fusionio.com>
Wed, 29 May 2013 18:54:47 +0000 (14:54 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Fri, 14 Jun 2013 15:30:06 +0000 (11:30 -0400)
commitd52be818e618bd252601b340ca6df760d77410e8
tree7d1fc410b90a96487cb3a949891fe2f6a5e96f87
parentc6adc9cc082e3cffda153999c9b9f8a8baaaaf45
Btrfs: simplify unlink reservations

Dave pointed out a problem where if you filled up a file system as much as
possible you couldn't remove any files.  The whole unlink reservation thing is
convoluted because it tries to guess if it's going to add space to unlink
something or not, and has all these odd uncommented cases where it simply does
not try.  So to fix this I've added a way to conditionally steal from the global
reserve if we can't make our normal reservation.  If we have more than half the
space in the global reserve free we will go ahead and steal from the global
reserve.  With this patch Dave's reproducer now works and I can rm all the files
on the file system.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c