]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix double range unlock of hole region when reading page
authorFilipe Manana <fdmanana@suse.com>
Tue, 13 Oct 2015 15:36:09 +0000 (16:36 +0100)
committerFilipe Manana <fdmanana@suse.com>
Wed, 14 Oct 2015 03:37:00 +0000 (04:37 +0100)
commit103ddfb7dbc0441c4d093094d6ce5c27db40373d
tree2365f8d86e36339d46affaecaccf456e21343538
parentd365277e2a447a58a4aaaa23aaae6776f953aac6
Btrfs: fix double range unlock of hole region when reading page

If when reading a page we find a hole and our caller had already locked
the range (bio flags has the bit EXTENT_BIO_PARENT_LOCKED set), we end
up unlocking the hole's range and then later our caller unlocks it
again, which might have already been locked by some other task once
the first unlock happened.

Currently this can only happen during a call to the extent_same ioctl,
as it's the only caller of __do_readpage() that sets the bit
EXTENT_BIO_PARENT_LOCKED for bio flags.

Fix this by leaving the unlock exclusively to the caller.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
fs/btrfs/extent_io.c