]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies
authorNeilBrown <neilb@suse.com>
Mon, 27 Jul 2015 01:48:52 +0000 (11:48 +1000)
committerNeilBrown <neilb@suse.com>
Mon, 3 Aug 2015 02:29:42 +0000 (12:29 +1000)
commit302b60d9a5195735fcc97dbf4056aa03b3e184cf
tree0d98d3b3de62c7689fbe58a6229c7d760d998c55
parent5cac980cd1f596f7f7cf31bc217548b3f5fda8d7
md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies

raid1_end_read_request() assumes that the In_sync bits are consistent
with the ->degaded count.
raid1_spare_active updates the In_sync bit before the ->degraded count
and so exposes an inconsistency, as does error()
So extend the spinlock in raid1_spare_active() and error() to hide those
inconsistencies.

This should probably be part of
  Commit: 5353b53c808a ("md/raid1: fix test for 'was read error from
  last working device'.")
as it addresses the same issue.  It fixes the same bug and should go
to -stable for same reasons.

Fixes: 01c5c367b9f9 ("md/raid1: clean up read_balance.")
Cc: stable@vger.kernel.org (v3.0+)
Signed-off-by: NeilBrown <neilb@suse.com>
drivers/md/raid1.c