diff options
author | David Sterba <dsterba@suse.com> | 2016-04-27 01:03:45 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-04-29 11:01:47 +0200 |
commit | 059f791c6bbaba72dc3c1bd6e2657aacc8552849 (patch) | |
tree | fa6c32312908c53934fb9a6b0815cb32fa18fb2e /fs | |
parent | 03bf5387708069194fbe5072fb57f9542e7a8b82 (diff) | |
download | op-kernel-dev-059f791c6bbaba72dc3c1bd6e2657aacc8552849.zip op-kernel-dev-059f791c6bbaba72dc3c1bd6e2657aacc8552849.tar.gz |
btrfs: make state preallocation more speculative in __set_extent_bit
Similar to __clear_extent_bit, do not fail if the state preallocation
fails as we might not need it. One less BUG_ON.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_io.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d39e224..8707bcc 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -873,8 +873,14 @@ __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, bits |= EXTENT_FIRST_DELALLOC; again: if (!prealloc && gfpflags_allow_blocking(mask)) { + /* + * Don't care for allocation failure here because we might end + * up not needing the pre-allocated extent state at all, which + * is the case if we only have in the tree extent states that + * cover our input range and don't cover too any other range. + * If we end up needing a new extent state we allocate it later. + */ prealloc = alloc_extent_state(mask); - BUG_ON(!prealloc); } spin_lock(&tree->lock); |