]> git.hungrycats.org Git - linux/commit
Btrfs: avoid premature -ENOMEM in clear_extent_bit()
authorFilipe Manana <fdmanana@suse.com>
Mon, 3 Nov 2014 14:12:57 +0000 (14:12 +0000)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 23 Jan 2015 13:17:22 +0000 (08:17 -0500)
commit344c5def60dbb033a24f2f02ffcfb67afc0e7072
tree7cf7a383002bdff5f174187c24d5fd3da088f5a1
parent0c1efed2facfb7f849e8cd3e3ee4885e9078af12
Btrfs: avoid premature -ENOMEM in clear_extent_bit()

We try to allocate an extent state structure before acquiring the extent
state tree's spinlock as we might need a new one later and therefore avoid
doing later an atomic allocation while holding the tree's spinlock. However
we returned -ENOMEM if that initial non-atomic allocation failed, which is
a bit excessive since we might end up not needing the pre-allocated extent
state at all - for the case where the tree doesn't have any extent states
that cover the input range and cover too any other range. Therefore don't
return -ENOMEM if that pre-allocation fails.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit c7bc6319c59cc791743cf1b6e98f86be69444495)
fs/btrfs/extent_io.c