]> git.ipfire.org Git - people/arne_f/kernel.git/commit
md/raid10: decrement correct pending counter when writing to replacement.
authorNeilBrown <neilb@suse.de>
Thu, 22 Nov 2012 04:12:09 +0000 (15:12 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Dec 2012 19:47:07 +0000 (11:47 -0800)
commitecf049ce86e1d93bc9a3376facf31d7244338089
tree1143b5ca06537fb8e35a8e2584d7059247df904d
parent8c98fbaa55508732bb5a9f46b3c6cf60daa8e526
md/raid10: decrement correct pending counter when writing to replacement.

commit 884162df2aadd7414bef4935e1a54976fd4e3988 upstream.

When a write to a replacement device completes, we carefully
and correctly found the rdev that the write actually went to
and the blithely called rdev_dec_pending on the primary rdev,
even if this write was to the replacement.

This means that any writes to an array while a replacement
was ongoing would cause the nr_pending count for the primary
device to go negative, so it could never be removed.

This bug has been present since replacement was introduced in
3.3, so it is suitable for any -stable kernel since then.

Reported-by: "George Spelvin" <linux@horizon.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid10.c