]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix possible panic on unmount
authorJosef Bacik <josef@redhat.com>
Fri, 13 Nov 2009 20:12:59 +0000 (20:12 +0000)
committerChris Mason <chris.mason@oracle.com>
Mon, 18 Jan 2010 01:40:30 +0000 (20:40 -0500)
commitd02eeee6ca144ede79e3681f44179bd313ec7d3b
tree83d5af6992db15ee61bc0c960626c378a2f5b436
parenta6fcfd51318db7eeb6b3fc6f10a829c45b261fe6
Btrfs: fix possible panic on unmount

We can race with the unmount of an fs and the stopping of a kthread where we
will free the block group before we're done using it.  The reason for this is
because we do not hold a reference on the block group while its caching, since
the allocator drops its reference once it exits or moves on to the next block
group.  This patch fixes the problem by taking a reference to the block group
before we start caching and dropping it when we're done to make sure all
accesses to the block group are safe.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c