]> git.baikalelectronics.ru Git - kernel.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)
committerNeilBrown <neilb@suse.de>
Tue, 3 Jul 2012 02:11:54 +0000 (12:11 +1000)
commitfee17f7d81299381c06b136aa667d9d7506ec433
tree78b6a6f246d35b13c3a37461187be7453d0972ba
parent81c0411d6e9e89d1912692c04cf4c867d60dec60
md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev

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  e2e585009c362a1d75c9
    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.

Cc: stable@vger.kernel.org
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c