]> git.baikalelectronics.ru Git - 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)
committerNeilBrown <neilb@suse.de>
Thu, 22 Nov 2012 04:12:42 +0000 (15:12 +1100)
commit1c27a545c86cc2fdf4b89b8a85c8c5a12978212b
treee562edba9a947346b124e9583de9d20f41c7f8c5
parent6b650db4580816d52fe617231bf28809867ab1bf
md/raid10: decrement correct pending counter when writing to replacement.

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>
Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c