mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev
commit1850753d2e
upstream. In ops_run_io(), the call to md_wait_for_blocked_rdev will decrement nr_pending so we lose the reference we hold on the rdev. So atomic_inc it first to maintain the reference. This bug was introduced by commit73e92e51b7
md/raid5. Don't write to known bad block on doubtful devices. which appeared in 3.0, so patch is suitable for stable kernels since then. Signed-off-by: majianpeng <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
65c3f18b90
commit
8d93698073
1 changed files with 6 additions and 0 deletions
|
@ -583,6 +583,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
|
|||
* a chance*/
|
||||
md_check_recovery(conf->mddev);
|
||||
}
|
||||
/*
|
||||
* Because md_wait_for_blocked_rdev
|
||||
* will dec nr_pending, we must
|
||||
* increment it first.
|
||||
*/
|
||||
atomic_inc(&rdev->nr_pending);
|
||||
md_wait_for_blocked_rdev(rdev, conf->mddev);
|
||||
} else {
|
||||
/* Acknowledged bad block - skip the write */
|
||||
|
|
Loading…
Reference in a new issue