[PATCH v2 08/12] dm error: return error for discards too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Have the error target respond to a discard request with a hard -EIO
rather than fail the request with -EOPNOTSUPP.

Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
---
 drivers/md/dm-target.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c
index 11dea11..98c31b0 100644
--- a/drivers/md/dm-target.c
+++ b/drivers/md/dm-target.c
@@ -113,6 +113,9 @@ void dm_unregister_target(struct target_type *tt)
  */
 static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args)
 {
+	/* return error for discards (rather than -EOPNOTSUPP) */
+	tt->num_discard_requests = 1;
+
 	return 0;
 }
 
-- 
1.6.6.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux