]> git.baikalelectronics.ru Git - kernel.git/commit
raid5: fix a race of stripe count check
authorShaohua Li <shli@kernel.org>
Tue, 15 Apr 2014 01:12:54 +0000 (09:12 +0800)
committerNeilBrown <neilb@suse.de>
Thu, 17 Apr 2014 07:05:28 +0000 (17:05 +1000)
commit7da446a9a55fa7246fef7a753b6ad078ed548f20
treebf4abac968402f11ba3d26e238ab62173f2bb23a
parentafa8ee521b91d16abbd92e6d3af1a7d1ca1f690c
raid5: fix a race of stripe count check

I hit another BUG_ON with afa8ee521b91d16abbd92e6. In __get_priority_stripe(),
stripe count equals to 0 initially. Between atomic_inc and BUG_ON,
get_active_stripe() finds the stripe. So the stripe count isn't 1 any more.

V2: keeps the BUG_ON suggested by Neil.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c