RAID1: ignore discard error
commit21faa6dbf53f6affbea63a008b1fa3ed3862cfa7
authorShaohua Li <shli@fb.com>
Thu, 6 Oct 2016 21:09:16 +0000 (6 14:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:38:53 +0000 (10 16:38 +0100)
tree1c6ac53c628bab0ba0da00e50fce291e602218fc
parentb80fcd58e6f6ab1a68a6d251fb8bba67e03df8ae
RAID1: ignore discard error

commit e3f948cd3283e4fbe5907f1f3967c839912f480e upstream.

If a write error occurs, raid1 will try to rewrite the bio in small
chunk size. If the rewrite fails, raid1 will record the error in bad
block. narrow_write_error will always use WRITE for the bio, but
actually it could be a discard. Since discard bio hasn't payload, write
the bio will cause different issues. But discard error isn't fatal, we
can safely ignore it. This is what this patch does.

This issue should exist since discard is added, but only exposed with
recent arbitrary bio size feature.

Reported-and-tested-by: Sitsofe Wheeler <sitsofe@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid1.c