diff options
| -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 d39e2241ceb7..8707bcc615ff 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, | |||
| 873 | bits |= EXTENT_FIRST_DELALLOC; | 873 | bits |= EXTENT_FIRST_DELALLOC; |
| 874 | again: | 874 | again: |
| 875 | if (!prealloc && gfpflags_allow_blocking(mask)) { | 875 | if (!prealloc && gfpflags_allow_blocking(mask)) { |
| 876 | /* | ||
| 877 | * Don't care for allocation failure here because we might end | ||
| 878 | * up not needing the pre-allocated extent state at all, which | ||
| 879 | * is the case if we only have in the tree extent states that | ||
| 880 | * cover our input range and don't cover too any other range. | ||
| 881 | * If we end up needing a new extent state we allocate it later. | ||
| 882 | */ | ||
| 876 | prealloc = alloc_extent_state(mask); | 883 | prealloc = alloc_extent_state(mask); |
| 877 | BUG_ON(!prealloc); | ||
| 878 | } | 884 | } |
| 879 | 885 | ||
| 880 | spin_lock(&tree->lock); | 886 | spin_lock(&tree->lock); |
