mirror of
https://github.com/torvalds/linux.git
synced 2024-12-31 23:31:29 +00:00
Btrfs: fix __btrfs_start_workers retval
__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> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
908960c6c0
commit
ba69994a40
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user