Btrfs: fix __btrfs_start_workers retval

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:04 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=ba69994a40b242bef26ab2683ea84aa29e2e429f
Commit:     ba69994a40b242bef26ab2683ea84aa29e2e429f
Parent:     908960c6c0fb3b3ce3971dc0ca47b581d256b968
Author:     Ilya Dryomov <idryomov at gmail.com>
AuthorDate: Sun Nov 3 19:06:40 2013 +0200
Committer:  Chris Mason <chris.mason at fusionio.com>
CommitDate: Wed Nov 20 20:42:11 2013 -0500

    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 at gmail.com>
    Signed-off-by: Josef Bacik <jbacik at fusionio.com>
    Signed-off-by: Chris Mason <chris.mason at fusionio.com>
---
 fs/btrfs/async-thread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 8aec751..c1e0b0c 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);



More information about the linux-mtd-cvs mailing list