]> git.baikalelectronics.ru Git - kernel.git/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)
committerChris Mason <clm@fb.com>
Fri, 21 Nov 2014 01:20:06 +0000 (17:20 -0800)
commit481deb7bcdf1791a8cb0f0510aae8dcc30563430
treeab6180b41c0dab292280b217fe88e3c24fbcf531
parent2d145cb77c5bdf2519a42325366e039cbb802d6d
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>
fs/btrfs/extent_io.c