summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-03 13:34:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-03 13:34:51 -0400
commitc6b1e36c8fa04a6680c44fe0321d0370400e90b6 (patch)
tree5110f0639bfa803baa8d213cb21efe37beeaf742 /drivers/md/dm-raid1.c
parent81e3e044897b0875a52953b3fb6241a33428e4f9 (diff)
parenta84ebb837b419787c2ece74efa566c998929cead (diff)
Merge branch 'for-4.13/block' of git://git.kernel.dk/linux-block
Pull core block/IO updates from Jens Axboe: "This is the main pull request for the block layer for 4.13. Not a huge round in terms of features, but there's a lot of churn related to some core cleanups. Note this depends on the UUID tree pull request, that Christoph already sent out. This pull request contains: - A series from Christoph, unifying the error/stats codes in the block layer. We now use blk_status_t everywhere, instead of using different schemes for different places. - Also from Christoph, some cleanups around request allocation and IO scheduler interactions in blk-mq. - And yet another series from Christoph, cleaning up how we handle and do bounce buffering in the block layer. - A blk-mq debugfs series from Bart, further improving on the support we have for exporting internal information to aid debugging IO hangs or stalls. - Also from Bart, a series that cleans up the request initialization differences across types of devices. - A series from Goldwyn Rodrigues, allowing the block layer to return failure if we will block and the user asked for non-blocking. - Patch from Hannes for supporting setting loop devices block size to that of the underlying device. - Two series of patches from Javier, fixing various issues with lightnvm, particular around pblk. - A series from me, adding support for write hints. This comes with NVMe support as well, so applications can help guide data placement on flash to improve performance, latencies, and write amplification. - A series from Ming, improving and hardening blk-mq support for stopping/starting and quiescing hardware queues. - Two pull requests for NVMe updates. Nothing major on the feature side, but lots of cleanups and bug fixes. From the usual crew. - A series from Neil Brown, greatly improving the bio rescue set support. Most notably, this kills the bio rescue work queues, if we don't really need them. - Lots of other little bug fixes that are all over the place" * 'for-4.13/block' of git://git.kernel.dk/linux-block: (217 commits) lightnvm: pblk: set line bitmap check under debug lightnvm: pblk: verify that cache read is still valid lightnvm: pblk: add initialization check lightnvm: pblk: remove target using async. I/Os lightnvm: pblk: use vmalloc for GC data buffer lightnvm: pblk: use right metadata buffer for recovery lightnvm: pblk: schedule if data is not ready lightnvm: pblk: remove unused return variable lightnvm: pblk: fix double-free on pblk init lightnvm: pblk: fix bad le64 assignations nvme: Makefile: remove dead build rule blk-mq: map all HWQ also in hyperthreaded system nvmet-rdma: register ib_client to not deadlock in device removal nvme_fc: fix error recovery on link down. nvmet_fc: fix crashes on bad opcodes nvme_fc: Fix crash when nvme controller connection fails. nvme_fc: replace ioabort msleep loop with completion nvme_fc: fix double calls to nvme_cleanup_cmd() nvme-fabrics: verify that a controller returns the correct NQN nvme: simplify nvme_dev_attrs_are_visible ...
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 4da8858856fb..a4fbd911d566 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -491,9 +491,9 @@ static void hold_bio(struct mirror_set *ms, struct bio *bio)
491 * If device is suspended, complete the bio. 491 * If device is suspended, complete the bio.
492 */ 492 */
493 if (dm_noflush_suspending(ms->ti)) 493 if (dm_noflush_suspending(ms->ti))
494 bio->bi_error = DM_ENDIO_REQUEUE; 494 bio->bi_status = BLK_STS_DM_REQUEUE;
495 else 495 else
496 bio->bi_error = -EIO; 496 bio->bi_status = BLK_STS_IOERR;
497 497
498 bio_endio(bio); 498 bio_endio(bio);
499 return; 499 return;
@@ -627,7 +627,7 @@ static void write_callback(unsigned long error, void *context)
627 * degrade the array. 627 * degrade the array.
628 */ 628 */
629 if (bio_op(bio) == REQ_OP_DISCARD) { 629 if (bio_op(bio) == REQ_OP_DISCARD) {
630 bio->bi_error = -EOPNOTSUPP; 630 bio->bi_status = BLK_STS_NOTSUPP;
631 bio_endio(bio); 631 bio_endio(bio);
632 return; 632 return;
633 } 633 }
@@ -1210,14 +1210,14 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
1210 1210
1211 r = log->type->in_sync(log, dm_rh_bio_to_region(ms->rh, bio), 0); 1211 r = log->type->in_sync(log, dm_rh_bio_to_region(ms->rh, bio), 0);
1212 if (r < 0 && r != -EWOULDBLOCK) 1212 if (r < 0 && r != -EWOULDBLOCK)
1213 return r; 1213 return DM_MAPIO_KILL;
1214 1214
1215 /* 1215 /*
1216 * If region is not in-sync queue the bio. 1216 * If region is not in-sync queue the bio.
1217 */ 1217 */
1218 if (!r || (r == -EWOULDBLOCK)) { 1218 if (!r || (r == -EWOULDBLOCK)) {
1219 if (bio->bi_opf & REQ_RAHEAD) 1219 if (bio->bi_opf & REQ_RAHEAD)
1220 return -EWOULDBLOCK; 1220 return DM_MAPIO_KILL;
1221 1221
1222 queue_bio(ms, bio, rw); 1222 queue_bio(ms, bio, rw);
1223 return DM_MAPIO_SUBMITTED; 1223 return DM_MAPIO_SUBMITTED;
@@ -1229,7 +1229,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
1229 */ 1229 */
1230 m = choose_mirror(ms, bio->bi_iter.bi_sector); 1230 m = choose_mirror(ms, bio->bi_iter.bi_sector);
1231 if (unlikely(!m)) 1231 if (unlikely(!m))
1232 return -EIO; 1232 return DM_MAPIO_KILL;
1233 1233
1234 dm_bio_record(&bio_record->details, bio); 1234 dm_bio_record(&bio_record->details, bio);
1235 bio_record->m = m; 1235 bio_record->m = m;
@@ -1239,7 +1239,8 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
1239 return DM_MAPIO_REMAPPED; 1239 return DM_MAPIO_REMAPPED;
1240} 1240}
1241 1241
1242static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error) 1242static int mirror_end_io(struct dm_target *ti, struct bio *bio,
1243 blk_status_t *error)
1243{ 1244{
1244 int rw = bio_data_dir(bio); 1245 int rw = bio_data_dir(bio);
1245 struct mirror_set *ms = (struct mirror_set *) ti->private; 1246 struct mirror_set *ms = (struct mirror_set *) ti->private;
@@ -1255,16 +1256,16 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
1255 if (!(bio->bi_opf & REQ_PREFLUSH) && 1256 if (!(bio->bi_opf & REQ_PREFLUSH) &&
1256 bio_op(bio) != REQ_OP_DISCARD) 1257 bio_op(bio) != REQ_OP_DISCARD)
1257 dm_rh_dec(ms->rh, bio_record->write_region); 1258 dm_rh_dec(ms->rh, bio_record->write_region);
1258 return error; 1259 return DM_ENDIO_DONE;
1259 } 1260 }
1260 1261
1261 if (error == -EOPNOTSUPP) 1262 if (*error == BLK_STS_NOTSUPP)
1262 goto out; 1263 goto out;
1263 1264
1264 if ((error == -EWOULDBLOCK) && (bio->bi_opf & REQ_RAHEAD)) 1265 if (bio->bi_opf & REQ_RAHEAD)
1265 goto out; 1266 goto out;
1266 1267
1267 if (unlikely(error)) { 1268 if (unlikely(*error)) {
1268 if (!bio_record->details.bi_bdev) { 1269 if (!bio_record->details.bi_bdev) {
1269 /* 1270 /*
1270 * There wasn't enough memory to record necessary 1271 * There wasn't enough memory to record necessary
@@ -1272,7 +1273,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
1272 * mirror in-sync. 1273 * mirror in-sync.
1273 */ 1274 */
1274 DMERR_LIMIT("Mirror read failed."); 1275 DMERR_LIMIT("Mirror read failed.");
1275 return -EIO; 1276 return DM_ENDIO_DONE;
1276 } 1277 }
1277 1278
1278 m = bio_record->m; 1279 m = bio_record->m;
@@ -1291,7 +1292,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
1291 1292
1292 dm_bio_restore(bd, bio); 1293 dm_bio_restore(bd, bio);
1293 bio_record->details.bi_bdev = NULL; 1294 bio_record->details.bi_bdev = NULL;
1294 bio->bi_error = 0; 1295 bio->bi_status = 0;
1295 1296
1296 queue_bio(ms, bio, rw); 1297 queue_bio(ms, bio, rw);
1297 return DM_ENDIO_INCOMPLETE; 1298 return DM_ENDIO_INCOMPLETE;
@@ -1302,7 +1303,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
1302out: 1303out:
1303 bio_record->details.bi_bdev = NULL; 1304 bio_record->details.bi_bdev = NULL;
1304 1305
1305 return error; 1306 return DM_ENDIO_DONE;
1306} 1307}
1307 1308
1308static void mirror_presuspend(struct dm_target *ti) 1309static void mirror_presuspend(struct dm_target *ti)