]> git.karo-electronics.de Git - karo-tx-linux.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>
Mon, 1 Oct 2012 19:19:27 +0000 (15:19 -0400)
commit5375a3ab87cacb84107542439dd219752c849381
tree2dff320a604ac441f6c73553fdbb03b2bb91eb53
parent6482a8097c1a09b5a1a67dab6debfa6aba590042
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