]> git.baikalelectronics.ru Git - kernel.git/commit
raid5: fix a small race condition
authorShaohua Li <shli@fb.com>
Thu, 8 Sep 2016 17:43:58 +0000 (10:43 -0700)
committerShaohua Li <shli@fb.com>
Fri, 9 Sep 2016 18:09:19 +0000 (11:09 -0700)
commiteb4282ca254375b7485acd58af1c45e9d5419dd2
tree7e3120b034308cb83e83e6f93f40745f206848cf
parentfec86c6aea2d6170be69b944eab1b5ca4c089933
raid5: fix a small race condition

commit 5cae949494f51a(raid5: fix memory leak of bio integrity data)
moves bio_reset to bio_endio. But it introduces a small race condition.
It does bio_reset after raid5_release_stripe, which could make the
stripe reusable and hence reuse the bio just before bio_reset. Moving
bio_reset before raid5_release_stripe is called should fix the race.

Reported-and-tested-by: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5.c