]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix race when getting the eb out of page->private
authorJosef Bacik <jbacik@fusionio.com>
Fri, 14 Sep 2012 17:43:01 +0000 (13:43 -0400)
committerChris Mason <chris.mason@fusionio.com>
Thu, 4 Oct 2012 13:39:59 +0000 (09:39 -0400)
commit67e061f3c774ae2ec7faacaea9392710bfe88960
tree1a702f18f5f903f86a66f7a73264d153adac8dcf
parent52f8969ccd951cfdedf0cbe6fc629924d206fa7f
Btrfs: fix race when getting the eb out of page->private

We can race when checking wether PagePrivate is set on a page and we
actually have an eb saved in the pages private pointer.  We could have
easily written out this page and released it in the time that we did the
pagevec lookup and actually got around to looking at this page.  So use
mapping->private_lock to ensure we get a consistent view of the
page->private pointer.  This is inline with the alloc and releasepage paths
which use private_lock when manipulating page->private.  Thanks,

Reported-by: David Sterba <dave@jikos.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent_io.c