Btrfs: fix race in worker_loop
authorAmit Gud <amitgud@gmail.com>
Thu, 2 Apr 2009 21:01:27 +0000 (17:01 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 2 Apr 2009 21:01:27 +0000 (17:01 -0400)
commitb5555f77115bfba3630fefff2d4e68140b644171
tree5a2712105e9e5e493ebf01b9b382828d91e046b8
parentdccae99995089641fbac452ebc7f0cab18751ddb
Btrfs: fix race in worker_loop

Need to check kthread_should_stop after schedule_timeout() before calling
schedule(). This causes threads to sleep with potentially no one to wake them
up causing mount(2) to hang in btrfs_stop_workers waiting for threads to stop.

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