Skip to content
Commit 6e74057c authored by Chris Mason's avatar Chris Mason
Browse files

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: default avatarChris Mason <chris.mason@oracle.com>
parent 627e421a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment