]> git.baikalelectronics.ru Git - kernel.git/commit
raid1: handle read error also in readonly mode
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Fri, 28 Oct 2016 12:45:58 +0000 (14:45 +0200)
committerShaohua Li <shli@fb.com>
Sat, 29 Oct 2016 05:04:04 +0000 (22:04 -0700)
commitb041956480fbd05944784a5b98436b62e53758bc
treec0d79a71c7d8171f034a58ffed73e274fbd689b5
parent321c19263b7e58a68378c8cae27570b872d39ce3
raid1: handle read error also in readonly mode

If write is the first operation on a disk and it happens not to be
aligned to page size, block layer sends read request first. If read
operation fails, the disk is set as failed as no attempt to fix the
error is made because array is in auto-readonly mode. Similarily, the
disk is set as failed for read-only array.

Take the same approach as in raid10. Don't fail the disk if array is in
readonly or auto-readonly mode. Try to redirect the request first and if
unsuccessful, return a read error.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid1.c