]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev
authormajianpeng <majianpeng@gmail.com>
Tue, 3 Jul 2012 02:11:54 +0000 (12:11 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:06 +0000 (04:32 +0100)
commit6b295c456aff465a7710259b2a6b5f06e654f850
treef6e03168bb11bb817c19513b9b00b26e54156720
parentebfdf3076402b08d6fd97141ac40149ff13f70ea
md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev

commit 1850753d2e6d9ca7856581ca5d3cf09521e6a5d7 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 commit  73e92e51b7969ef5477d
    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: Ben Hutchings <ben@decadent.org.uk>
drivers/md/raid5.c