]> git.baikalelectronics.ru Git - kernel.git/commit
md: avoid a possibility that a read error can wrongly propagate through md/raid1...
authorNeilBrown <neilb@suse.de>
Thu, 10 May 2007 10:15:50 +0000 (03:15 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 10 May 2007 16:26:53 +0000 (09:26 -0700)
commit33616f590b2b699bd839681d91994be4f1000dc9
tree2bb5bfafc0de89bd00ef530540e91e8297fc5d57
parent2a45c6b604fec73e88855668aa6c5524f2957b52
md: avoid a possibility that a read error can wrongly propagate through md/raid1 to a filesystem.

When a raid1 has only one working drive, we want read error to propagate up
to the filesystem as there is no point failing the last drive in an array.

Currently the code perform this check is racy.  If a write and a read a
both submitted to a device on a 2-drive raid1, and the write fails followed
by the read failing, the read will see that there is only one working drive
and will pass the failure up, even though the one working drive is actually
the *other* one.

So, tighten up the locking.

Signed-off-by: Neil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/raid1.c