Skip to content

Commit ed09441

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (39 commits) [SCSI] sd: fix compile failure with CONFIG_BLK_DEV_INTEGRITY=n libiscsi: fix locking in iscsi_eh_device_reset libiscsi: check reason why we are stopping iscsi session to determine error value [SCSI] iscsi_tcp: return a descriptive error value during connection errors [SCSI] libiscsi: rename host reset to target reset [SCSI] iscsi class: fix endpoint id handling [SCSI] libiscsi: Support drivers initiating session removal [SCSI] libiscsi: fix data corruption when target has to resend data-in packets [SCSI] sd: Switch kernel printing level for DIF messages [SCSI] sd: Correctly handle all combinations of DIF and DIX [SCSI] sd: Always print actual protection_type [SCSI] sd: Issue correct protection operation [SCSI] scsi_error: fix target reset handling [SCSI] lpfc 8.2.8 v2 : Add statistical reporting control and additional fc vendor events [SCSI] lpfc 8.2.8 v2 : Add sysfs control of target queue depth handling [SCSI] lpfc 8.2.8 v2 : Revert target busy in favor of transport disrupted [SCSI] scsi_dh_alua: remove REQ_NOMERGE [SCSI] lpfc 8.2.8 : update driver version to 8.2.8 [SCSI] lpfc 8.2.8 : Add MSI-X support [SCSI] lpfc 8.2.8 : Update driver to use new Host byte error code DID_TRANSPORT_DISRUPTED ...
2 parents b225ee5 + 4c393e6 commit ed09441

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+8003
-1111
lines changed

block/blk-core.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,15 @@ void init_request_from_bio(struct request *req, struct bio *bio)
10751075
/*
10761076
* inherit FAILFAST from bio (for read-ahead, and explicit FAILFAST)
10771077
*/
1078-
if (bio_rw_ahead(bio) || bio_failfast(bio))
1079-
req->cmd_flags |= REQ_FAILFAST;
1078+
if (bio_rw_ahead(bio))
1079+
req->cmd_flags |= (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
1080+
REQ_FAILFAST_DRIVER);
1081+
if (bio_failfast_dev(bio))
1082+
req->cmd_flags |= REQ_FAILFAST_DEV;
1083+
if (bio_failfast_transport(bio))
1084+
req->cmd_flags |= REQ_FAILFAST_TRANSPORT;
1085+
if (bio_failfast_driver(bio))
1086+
req->cmd_flags |= REQ_FAILFAST_DRIVER;
10801087

10811088
/*
10821089
* REQ_BARRIER implies no merging, but lets make it explicit

drivers/infiniband/ulp/iser/iscsi_iser.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ static void iscsi_iser_session_destroy(struct iscsi_cls_session *cls_session)
378378
{
379379
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
380380

381+
iscsi_session_teardown(cls_session);
381382
iscsi_host_remove(shost);
382383
iscsi_host_free(shost);
383384
}
@@ -597,7 +598,7 @@ static struct scsi_host_template iscsi_iser_sht = {
597598
.cmd_per_lun = ISCSI_MAX_CMD_PER_LUN,
598599
.eh_abort_handler = iscsi_eh_abort,
599600
.eh_device_reset_handler= iscsi_eh_device_reset,
600-
.eh_host_reset_handler = iscsi_eh_host_reset,
601+
.eh_target_reset_handler= iscsi_eh_target_reset,
601602
.use_clustering = DISABLE_CLUSTERING,
602603
.proc_name = "iscsi_iser",
603604
.this_id = -1,

drivers/md/dm-mpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static int multipath_map(struct dm_target *ti, struct bio *bio,
849849
dm_bio_record(&mpio->details, bio);
850850

851851
map_context->ptr = mpio;
852-
bio->bi_rw |= (1 << BIO_RW_FAILFAST);
852+
bio->bi_rw |= (1 << BIO_RW_FAILFAST_TRANSPORT);
853853
r = map_io(m, bio, mpio, 0);
854854
if (r < 0 || r == DM_MAPIO_REQUEUE)
855855
mempool_free(mpio, m->mpio_pool);

drivers/md/multipath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
167167
mp_bh->bio = *bio;
168168
mp_bh->bio.bi_sector += multipath->rdev->data_offset;
169169
mp_bh->bio.bi_bdev = multipath->rdev->bdev;
170-
mp_bh->bio.bi_rw |= (1 << BIO_RW_FAILFAST);
170+
mp_bh->bio.bi_rw |= (1 << BIO_RW_FAILFAST_TRANSPORT);
171171
mp_bh->bio.bi_end_io = multipath_end_request;
172172
mp_bh->bio.bi_private = mp_bh;
173173
generic_make_request(&mp_bh->bio);
@@ -393,7 +393,7 @@ static void multipathd (mddev_t *mddev)
393393
*bio = *(mp_bh->master_bio);
394394
bio->bi_sector += conf->multipaths[mp_bh->path].rdev->data_offset;
395395
bio->bi_bdev = conf->multipaths[mp_bh->path].rdev->bdev;
396-
bio->bi_rw |= (1 << BIO_RW_FAILFAST);
396+
bio->bi_rw |= (1 << BIO_RW_FAILFAST_TRANSPORT);
397397
bio->bi_end_io = multipath_end_request;
398398
bio->bi_private = mp_bh;
399399
generic_make_request(bio);

drivers/s390/block/dasd_diag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev,
544544
}
545545
cqr->retries = DIAG_MAX_RETRIES;
546546
cqr->buildclk = get_clock();
547-
if (req->cmd_flags & REQ_FAILFAST)
547+
if (blk_noretry_request(req))
548548
set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags);
549549
cqr->startdev = memdev;
550550
cqr->memdev = memdev;

drivers/s390/block/dasd_eckd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
17001700
recid++;
17011701
}
17021702
}
1703-
if (req->cmd_flags & REQ_FAILFAST)
1703+
if (blk_noretry_request(req))
17041704
set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags);
17051705
cqr->startdev = startdev;
17061706
cqr->memdev = startdev;

drivers/s390/block/dasd_fba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev,
355355
recid++;
356356
}
357357
}
358-
if (req->cmd_flags & REQ_FAILFAST)
358+
if (blk_noretry_request(req))
359359
set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags);
360360
cqr->startdev = memdev;
361361
cqr->memdev = memdev;

drivers/scsi/constants.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,8 @@ EXPORT_SYMBOL(scsi_print_sense);
13641364
static const char * const hostbyte_table[]={
13651365
"DID_OK", "DID_NO_CONNECT", "DID_BUS_BUSY", "DID_TIME_OUT", "DID_BAD_TARGET",
13661366
"DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR",
1367-
"DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY", "DID_REQUEUE"};
1367+
"DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY", "DID_REQUEUE",
1368+
"DID_TRANSPORT_DISRUPTED", "DID_TRANSPORT_FAILFAST" };
13681369
#define NUM_HOSTBYTE_STRS ARRAY_SIZE(hostbyte_table)
13691370

13701371
static const char * const driverbyte_table[]={

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ static struct request *get_alua_req(struct scsi_device *sdev,
109109
}
110110

111111
rq->cmd_type = REQ_TYPE_BLOCK_PC;
112-
rq->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE;
112+
rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
113+
REQ_FAILFAST_DRIVER;
113114
rq->retries = ALUA_FAILOVER_RETRIES;
114115
rq->timeout = ALUA_FAILOVER_TIMEOUT;
115116

drivers/scsi/device_handler/scsi_dh_emc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
303303

304304
rq->cmd[4] = len;
305305
rq->cmd_type = REQ_TYPE_BLOCK_PC;
306-
rq->cmd_flags |= REQ_FAILFAST;
306+
rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
307+
REQ_FAILFAST_DRIVER;
307308
rq->timeout = CLARIION_TIMEOUT;
308309
rq->retries = CLARIION_RETRIES;
309310

drivers/scsi/device_handler/scsi_dh_hp_sw.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
112112
return SCSI_DH_RES_TEMP_UNAVAIL;
113113

114114
req->cmd_type = REQ_TYPE_BLOCK_PC;
115-
req->cmd_flags |= REQ_FAILFAST;
115+
req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
116+
REQ_FAILFAST_DRIVER;
116117
req->cmd_len = COMMAND_SIZE(TEST_UNIT_READY);
117118
req->cmd[0] = TEST_UNIT_READY;
118119
req->timeout = HP_SW_TIMEOUT;
@@ -204,7 +205,8 @@ static int hp_sw_start_stop(struct scsi_device *sdev, struct hp_sw_dh_data *h)
204205
return SCSI_DH_RES_TEMP_UNAVAIL;
205206

206207
req->cmd_type = REQ_TYPE_BLOCK_PC;
207-
req->cmd_flags |= REQ_FAILFAST;
208+
req->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
209+
REQ_FAILFAST_DRIVER;
208210
req->cmd_len = COMMAND_SIZE(START_STOP);
209211
req->cmd[0] = START_STOP;
210212
req->cmd[4] = 1; /* Start spin cycle */

drivers/scsi/device_handler/scsi_dh_rdac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ static struct request *get_rdac_req(struct scsi_device *sdev,
226226
}
227227

228228
rq->cmd_type = REQ_TYPE_BLOCK_PC;
229-
rq->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE;
229+
rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
230+
REQ_FAILFAST_DRIVER;
230231
rq->retries = RDAC_RETRIES;
231232
rq->timeout = RDAC_TIMEOUT;
232233

drivers/scsi/ibmvscsi/ibmvfc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,8 +2031,6 @@ static void ibmvfc_terminate_rport_io(struct fc_rport *rport)
20312031
spin_unlock_irqrestore(shost->host_lock, flags);
20322032
} else
20332033
ibmvfc_issue_fc_host_lip(shost);
2034-
2035-
scsi_target_unblock(&rport->dev);
20362034
LEAVE;
20372035
}
20382036

drivers/scsi/iscsi_tcp.c

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -523,22 +523,20 @@ iscsi_tcp_cleanup_task(struct iscsi_conn *conn, struct iscsi_task *task)
523523
}
524524

525525
/**
526-
* iscsi_data_rsp - SCSI Data-In Response processing
526+
* iscsi_data_in - SCSI Data-In Response processing
527527
* @conn: iscsi connection
528528
* @task: scsi command task
529529
**/
530530
static int
531-
iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
531+
iscsi_data_in(struct iscsi_conn *conn, struct iscsi_task *task)
532532
{
533533
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
534534
struct iscsi_tcp_task *tcp_task = task->dd_data;
535535
struct iscsi_data_rsp *rhdr = (struct iscsi_data_rsp *)tcp_conn->in.hdr;
536-
struct iscsi_session *session = conn->session;
537-
struct scsi_cmnd *sc = task->sc;
538536
int datasn = be32_to_cpu(rhdr->datasn);
539-
unsigned total_in_length = scsi_in(sc)->length;
537+
unsigned total_in_length = scsi_in(task->sc)->length;
540538

541-
iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr);
539+
iscsi_update_cmdsn(conn->session, (struct iscsi_nopin*)rhdr);
542540
if (tcp_conn->in.datalen == 0)
543541
return 0;
544542

@@ -558,23 +556,6 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
558556
return ISCSI_ERR_DATA_OFFSET;
559557
}
560558

561-
if (rhdr->flags & ISCSI_FLAG_DATA_STATUS) {
562-
sc->result = (DID_OK << 16) | rhdr->cmd_status;
563-
conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
564-
if (rhdr->flags & (ISCSI_FLAG_DATA_UNDERFLOW |
565-
ISCSI_FLAG_DATA_OVERFLOW)) {
566-
int res_count = be32_to_cpu(rhdr->residual_count);
567-
568-
if (res_count > 0 &&
569-
(rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW ||
570-
res_count <= total_in_length))
571-
scsi_in(sc)->resid = res_count;
572-
else
573-
sc->result = (DID_BAD_TARGET << 16) |
574-
rhdr->cmd_status;
575-
}
576-
}
577-
578559
conn->datain_pdus_cnt++;
579560
return 0;
580561
}
@@ -774,7 +755,7 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
774755
if (!task)
775756
rc = ISCSI_ERR_BAD_ITT;
776757
else
777-
rc = iscsi_data_rsp(conn, task);
758+
rc = iscsi_data_in(conn, task);
778759
if (rc) {
779760
spin_unlock(&conn->session->lock);
780761
break;
@@ -998,7 +979,7 @@ iscsi_tcp_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
998979

999980
error:
1000981
debug_tcp("Error receiving PDU, errno=%d\n", rc);
1001-
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
982+
iscsi_conn_failure(conn, rc);
1002983
return 0;
1003984
}
1004985

@@ -1117,8 +1098,10 @@ iscsi_xmit(struct iscsi_conn *conn)
11171098

11181099
while (1) {
11191100
rc = iscsi_tcp_xmit_segment(tcp_conn, segment);
1120-
if (rc < 0)
1101+
if (rc < 0) {
1102+
rc = ISCSI_ERR_XMIT_FAILED;
11211103
goto error;
1104+
}
11221105
if (rc == 0)
11231106
break;
11241107

@@ -1127,7 +1110,7 @@ iscsi_xmit(struct iscsi_conn *conn)
11271110
if (segment->total_copied >= segment->total_size) {
11281111
if (segment->done != NULL) {
11291112
rc = segment->done(tcp_conn, segment);
1130-
if (rc < 0)
1113+
if (rc != 0)
11311114
goto error;
11321115
}
11331116
}
@@ -1142,8 +1125,8 @@ iscsi_xmit(struct iscsi_conn *conn)
11421125
/* Transmit error. We could initiate error recovery
11431126
* here. */
11441127
debug_tcp("Error sending PDU, errno=%d\n", rc);
1145-
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1146-
return rc;
1128+
iscsi_conn_failure(conn, rc);
1129+
return -EIO;
11471130
}
11481131

11491132
/**
@@ -1904,6 +1887,7 @@ static void iscsi_tcp_session_destroy(struct iscsi_cls_session *cls_session)
19041887
struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
19051888

19061889
iscsi_r2tpool_free(cls_session->dd_data);
1890+
iscsi_session_teardown(cls_session);
19071891

19081892
iscsi_host_remove(shost);
19091893
iscsi_host_free(shost);
@@ -1927,7 +1911,7 @@ static struct scsi_host_template iscsi_sht = {
19271911
.cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
19281912
.eh_abort_handler = iscsi_eh_abort,
19291913
.eh_device_reset_handler= iscsi_eh_device_reset,
1930-
.eh_host_reset_handler = iscsi_eh_host_reset,
1914+
.eh_target_reset_handler= iscsi_eh_target_reset,
19311915
.use_clustering = DISABLE_CLUSTERING,
19321916
.slave_configure = iscsi_tcp_slave_configure,
19331917
.proc_name = "iscsi_tcp",

0 commit comments

Comments
 (0)