]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag '3.15-fixes' of git://neil.brown.name/md
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Apr 2014 17:51:01 +0000 (10:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Apr 2014 17:51:01 +0000 (10:51 -0700)
Pull md bugfix from Neil Brown:
 "One BUG fix for md for recent commit"

* tag '3.15-fixes' of git://neil.brown.name/md:
  raid5: fix a race of stripe count check

drivers/md/raid5.c

index 25247a8529124f7cc93eda0db7033655d52f2ef7..ad1b9bea446ebdbaea0083cb976ed4207c618cc1 100644 (file)
@@ -4370,8 +4370,7 @@ static struct stripe_head *__get_priority_stripe(struct r5conf *conf, int group)
                sh->group = NULL;
        }
        list_del_init(&sh->lru);
-       atomic_inc(&sh->count);
-       BUG_ON(atomic_read(&sh->count) != 1);
+       BUG_ON(atomic_inc_return(&sh->count) != 1);
        return sh;
 }