aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2010-08-11 23:14:32 -0400
committerAlasdair G Kergon <agk@redhat.com>2010-08-11 23:14:32 -0400
commit959eb4e5592cc0b0b07db0ca30d2b1efd790020f (patch)
tree564a22942512825ca1f466ae9d18ffe9fd7bf1fb
parent7b76ec11fec40203836b488496d2df082d5b2022 (diff)
dm mpath: support discard
Enable discard support in the DM multipath target. This discard support depends on a few discard-specific fixes to the block layer's request stacking driver methods. Discard requests are optional so don't allow a failed discard to trigger path failures. If there is a real problem with a given path the barriers associated with the discard (either before or after the discard) will cause path failure. That said, unconditionally passing discard failures up the stack is not ideal. This must be fixed once DM has more information about the nature of the underlying storage failure. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
-rw-r--r--drivers/md/dm-mpath.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index da2223aa727f..487ecda90ad4 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -893,6 +893,7 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
893 } 893 }
894 894
895 ti->num_flush_requests = 1; 895 ti->num_flush_requests = 1;
896 ti->num_discard_requests = 1;
896 897
897 return 0; 898 return 0;
898 899
@@ -1272,6 +1273,15 @@ static int do_end_io(struct multipath *m, struct request *clone,
1272 if (error == -EOPNOTSUPP) 1273 if (error == -EOPNOTSUPP)
1273 return error; 1274 return error;
1274 1275
1276 if (clone->cmd_flags & REQ_DISCARD)
1277 /*
1278 * Pass all discard request failures up.
1279 * FIXME: only fail_path if the discard failed due to a
1280 * transport problem. This requires precise understanding
1281 * of the underlying failure (e.g. the SCSI sense).
1282 */
1283 return error;
1284
1275 if (mpio->pgpath) 1285 if (mpio->pgpath)
1276 fail_path(mpio->pgpath); 1286 fail_path(mpio->pgpath);
1277 1287