Skip to content

Commit ba69994

Browse files
idryomovChris Mason
authored andcommitted
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>
1 parent 908960c commit ba69994

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/btrfs/async-thread.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ static int __btrfs_start_workers(struct btrfs_workers *workers)
495495
spin_lock_irq(&workers->lock);
496496
if (workers->stopping) {
497497
spin_unlock_irq(&workers->lock);
498+
ret = -EINVAL;
498499
goto fail_kthread;
499500
}
500501
list_add_tail(&worker->worker_list, &workers->idle_list);

0 commit comments

Comments
 (0)