]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm mirror: do not degrade the mirror on discard error
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 12 Feb 2015 15:09:20 +0000 (10:09 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 24 Mar 2015 01:02:47 +0000 (21:02 -0400)
commit0a877dfa4f182dce29daae4d44f599c4f9e6f625
treee1a87bc9c63fe4e3905dd373c6e7313be93ffc0b
parent0e60c3831e89d65fd4cd0be066162287b642682f
dm mirror: do not degrade the mirror on discard error

commit f2ed51ac64611d717d1917820a01930174c2f236 upstream.

It may be possible that a device claims discard support but it rejects
discards with -EOPNOTSUPP.  It happens when using loopback on ext2/ext3
filesystem driven by the ext4 driver.  It may also happen if the
underlying devices are moved from one disk on another.

If discard error happens, we reject the bio with -EOPNOTSUPP, but we do
not degrade the array.

This patch fixes failed test shell/lvconvert-repair-transient.sh in the
lvm2 testsuite if the testsuite is extracted on an ext2 or ext3
filesystem and it is being driven by the ext4 driver.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid1.c