Message ID | 1383498400-21009-3-git-send-email-idryomov@gmail.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 08cc08f..1d5f3d7 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -495,6 +495,7 @@ static int __btrfs_start_workers(struct btrfs_workers *workers) spin_lock_irq(&workers->lock); if (workers->stopping) { spin_unlock_irq(&workers->lock); + ret = -EINVAL; goto fail_kthread; } list_add_tail(&worker->worker_list, &workers->idle_list);
__btrfs_start_workers returns 0 in case it raced with btrfs_stop_workers and lost the race. This is wrong because worker in this case is not allowed to start and is in fact destroyed. Return -EINVAL instead. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> --- fs/btrfs/async-thread.c | 1 + 1 file changed, 1 insertion(+)