]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: Fix async thread shutdown race
authorChris Mason <chris.mason@oracle.com>
Wed, 16 Sep 2009 00:02:33 +0000 (20:02 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Sep 2009 00:20:17 +0000 (20:20 -0400)
commit22f8ac09565e5192627b5887604b4afeb526030f
treee7c70b8e08ab9e5363be28bcbcc72348122ae6e4
parentd347169ea4fb07b10261b0afdd43b7bda4ce84fb
Btrfs: Fix async thread shutdown race

It was possible for an async worker thread to be selected to
receive a new work item, but exit before the work item was
actually placed into that thread's work list.

This commit fixes the race by incrementing the num_pending
counter earlier, and making sure to check the number of pending
work items before a thread exits.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/async-thread.c