summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-17 19:51:01 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-17 19:51:01 +0200
commit23c1a60e2e9d7d07f5f686e6413fc92bfb84366f (patch)
treebb1f49058080c1daace69722f464f01836e7ff1a /drivers/md
parentMerge tag 'fbdev-reorder-3.15' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parentraid5: fix a race of stripe count check (diff)
downloadlinux-23c1a60e2e9d7d07f5f686e6413fc92bfb84366f.tar.xz
linux-23c1a60e2e9d7d07f5f686e6413fc92bfb84366f.zip
Merge tag '3.15-fixes' of git://neil.brown.name/md
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
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 25247a852912..ad1b9bea446e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -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;
}