]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix ENOSPC caused by orphan items reservations
authorOmar Sandoval <osandov@fb.com>
Fri, 11 May 2018 20:13:37 +0000 (13:13 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:23:54 +0000 (18:23 +0200)
commit8d54b8077741ccf67dfdc1dae06856de132be355
treebcdc9176cd2c5ef3760846c28b21dd900c14b744
parentac85ec3698dfc9b22fd35187d62f99a5b7bc55bd
Btrfs: fix ENOSPC caused by orphan items reservations

Currently, we keep space reserved for all inode orphan items until the
inode is evicted (i.e., all references to it are dropped). We hit an
issue where an application would keep a bunch of deleted files open (by
design) and thus keep a large amount of space reserved, causing ENOSPC
errors when other operations tried to reserve space. This long-standing
reservation isn't absolutely necessary for a couple of reasons:

- We can almost always make the reservation we need or steal from the
  global reserve for the orphan item
- If we can't, it's not the end of the world if we drop the orphan item
  on the floor and let the next mount clean it up

So, get rid of persistent reservation and just reserve space in
btrfs_evict_inode().

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c