Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Two fixes: the libsas fix is for a problem that occurs when trying to
change the cache type of an ATA device and the libiscsi one is a
regression fix from this merge window"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: libsas: Reset num_scatter if libata marks qc as NODATA
scsi: iscsi: Fix iSCSI cls conn state

+23 -32
+3 -23
drivers/scsi/libiscsi.c
··· 3179 3179 } 3180 3180 } 3181 3181 3182 - static void iscsi_start_session_recovery(struct iscsi_session *session, 3183 - struct iscsi_conn *conn, int flag) 3182 + void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) 3184 3183 { 3184 + struct iscsi_conn *conn = cls_conn->dd_data; 3185 + struct iscsi_session *session = conn->session; 3185 3186 int old_stop_stage; 3186 3187 3187 3188 mutex_lock(&session->eh_mutex); ··· 3239 3238 memset(&conn->tmhdr, 0, sizeof(conn->tmhdr)); 3240 3239 spin_unlock_bh(&session->frwd_lock); 3241 3240 mutex_unlock(&session->eh_mutex); 3242 - } 3243 - 3244 - void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) 3245 - { 3246 - struct iscsi_conn *conn = cls_conn->dd_data; 3247 - struct iscsi_session *session = conn->session; 3248 - 3249 - switch (flag) { 3250 - case STOP_CONN_RECOVER: 3251 - cls_conn->state = ISCSI_CONN_FAILED; 3252 - break; 3253 - case STOP_CONN_TERM: 3254 - cls_conn->state = ISCSI_CONN_DOWN; 3255 - break; 3256 - default: 3257 - iscsi_conn_printk(KERN_ERR, conn, 3258 - "invalid stop flag %d\n", flag); 3259 - return; 3260 - } 3261 - 3262 - iscsi_start_session_recovery(session, conn, flag); 3263 3241 } 3264 3242 EXPORT_SYMBOL_GPL(iscsi_conn_stop); 3265 3243
+4 -5
drivers/scsi/libsas/sas_ata.c
··· 201 201 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); 202 202 task->total_xfer_len = qc->nbytes; 203 203 task->num_scatter = qc->n_elem; 204 + task->data_dir = qc->dma_dir; 205 + } else if (qc->tf.protocol == ATA_PROT_NODATA) { 206 + task->data_dir = DMA_NONE; 204 207 } else { 205 208 for_each_sg(qc->sg, sg, qc->n_elem, si) 206 209 xfer += sg_dma_len(sg); 207 210 208 211 task->total_xfer_len = xfer; 209 212 task->num_scatter = si; 210 - } 211 - 212 - if (qc->tf.protocol == ATA_PROT_NODATA) 213 - task->data_dir = DMA_NONE; 214 - else 215 213 task->data_dir = qc->dma_dir; 214 + } 216 215 task->scatter = qc->sg; 217 216 task->ata_task.retry_count = 1; 218 217 task->task_state_flags = SAS_TASK_STATE_PENDING;
+16 -4
drivers/scsi/scsi_transport_iscsi.c
··· 2474 2474 * it works. 2475 2475 */ 2476 2476 mutex_lock(&conn_mutex); 2477 - conn->transport->stop_conn(conn, flag); 2478 - conn->state = ISCSI_CONN_DOWN; 2479 - mutex_unlock(&conn_mutex); 2477 + switch (flag) { 2478 + case STOP_CONN_RECOVER: 2479 + conn->state = ISCSI_CONN_FAILED; 2480 + break; 2481 + case STOP_CONN_TERM: 2482 + conn->state = ISCSI_CONN_DOWN; 2483 + break; 2484 + default: 2485 + iscsi_cls_conn_printk(KERN_ERR, conn, 2486 + "invalid stop flag %d\n", flag); 2487 + goto unlock; 2488 + } 2480 2489 2490 + conn->transport->stop_conn(conn, flag); 2491 + unlock: 2492 + mutex_unlock(&conn_mutex); 2481 2493 } 2482 2494 2483 2495 static void stop_conn_work_fn(struct work_struct *work) ··· 2980 2968 mutex_lock(&conn->ep_mutex); 2981 2969 conn->ep = NULL; 2982 2970 mutex_unlock(&conn->ep_mutex); 2983 - conn->state = ISCSI_CONN_DOWN; 2971 + conn->state = ISCSI_CONN_FAILED; 2984 2972 } 2985 2973 2986 2974 transport->ep_disconnect(ep);