summaryrefslogtreecommitdiff
path: root/fs/btrfs/check-integrity.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2014-10-13 15:28:39 +0400
committerChris Mason <clm@fb.com>2014-11-21 04:14:29 +0300
commitc8fd3de79f44f5d41bc3a801214faf667b95df9d (patch)
tree493fbd0a05415f8aa2416564b19cea6c3544564a /fs/btrfs/check-integrity.c
parente38e2ed701ff5f3d889c8dda5fe863e165e60d61 (diff)
downloadlinux-c8fd3de79f44f5d41bc3a801214faf667b95df9d.tar.xz
Btrfs: avoid returning -ENOMEM in convert_extent_bit() too early
We try to allocate an extent state before acquiring the tree's spinlock just in case we end up needing to split an existing extent state into two. If that allocation failed, we would return -ENOMEM. However, our only single caller (transaction/log commit code), passes in an extent state that was cached from a call to find_first_extent_bit() and that has a very high chance to match exactly the input range (always true for a transaction commit and very often, but not always, true for a log commit) - in this case we end up not needing at all that initial extent state used for an eventual split. Therefore just don't return -ENOMEM if we can't allocate the temporary extent state, since we might not need it at all, and if we end up needing one, we'll do it later anyway. Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/check-integrity.c')
0 files changed, 0 insertions, 0 deletions