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:
"This has two libfc fixes for bugs causing rare crashes, one iscsi fix
for a potential hang on shutdown, and a fix for an I/O blocksize issue
which caused a regression"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
sd: Fix maximum I/O size for BLOCK_PC requests
libfc: Fix fc_fcp_cleanup_each_cmd()
libfc: Fix fc_exch_recv_req() error path
libiscsi: Fix host busy blocking during connection teardown

+28 -34
+2 -2
block/blk-settings.c
··· 241 241 * Description: 242 242 * Enables a low level driver to set a hard upper limit, 243 243 * max_hw_sectors, on the size of requests. max_hw_sectors is set by 244 - * the device driver based upon the combined capabilities of I/O 245 - * controller and storage device. 244 + * the device driver based upon the capabilities of the I/O 245 + * controller. 246 246 * 247 247 * max_sectors is a soft limit imposed by the block layer for 248 248 * filesystem type requests. This value can be overridden on a
+4 -4
drivers/scsi/libfc/fc_exch.c
··· 733 733 if (resp) { 734 734 resp(sp, fp, arg); 735 735 res = true; 736 - } else if (!IS_ERR(fp)) { 737 - fc_frame_free(fp); 738 736 } 739 737 740 738 spin_lock_bh(&ep->ex_lock); ··· 1594 1596 * If new exch resp handler is valid then call that 1595 1597 * first. 1596 1598 */ 1597 - fc_invoke_resp(ep, sp, fp); 1599 + if (!fc_invoke_resp(ep, sp, fp)) 1600 + fc_frame_free(fp); 1598 1601 1599 1602 fc_exch_release(ep); 1600 1603 return; ··· 1694 1695 fc_exch_hold(ep); 1695 1696 if (!rc) 1696 1697 fc_exch_delete(ep); 1697 - fc_invoke_resp(ep, sp, fp); 1698 + if (!fc_invoke_resp(ep, sp, fp)) 1699 + fc_frame_free(fp); 1698 1700 if (has_rec) 1699 1701 fc_exch_timer_set(ep, ep->r_a_tov); 1700 1702 fc_exch_release(ep);
+17 -2
drivers/scsi/libfc/fc_fcp.c
··· 1039 1039 fc_fcp_pkt_hold(fsp); 1040 1040 spin_unlock_irqrestore(&si->scsi_queue_lock, flags); 1041 1041 1042 - if (!fc_fcp_lock_pkt(fsp)) { 1042 + spin_lock_bh(&fsp->scsi_pkt_lock); 1043 + if (!(fsp->state & FC_SRB_COMPL)) { 1044 + fsp->state |= FC_SRB_COMPL; 1045 + /* 1046 + * TODO: dropping scsi_pkt_lock and then reacquiring 1047 + * again around fc_fcp_cleanup_cmd() is required, 1048 + * since fc_fcp_cleanup_cmd() calls into 1049 + * fc_seq_set_resp() and that func preempts cpu using 1050 + * schedule. May be schedule and related code should be 1051 + * removed instead of unlocking here to avoid scheduling 1052 + * while atomic bug. 1053 + */ 1054 + spin_unlock_bh(&fsp->scsi_pkt_lock); 1055 + 1043 1056 fc_fcp_cleanup_cmd(fsp, error); 1057 + 1058 + spin_lock_bh(&fsp->scsi_pkt_lock); 1044 1059 fc_io_compl(fsp); 1045 - fc_fcp_unlock_pkt(fsp); 1046 1060 } 1061 + spin_unlock_bh(&fsp->scsi_pkt_lock); 1047 1062 1048 1063 fc_fcp_pkt_release(fsp); 1049 1064 spin_lock_irqsave(&si->scsi_queue_lock, flags);
+2 -23
drivers/scsi/libiscsi.c
··· 2941 2941 { 2942 2942 struct iscsi_conn *conn = cls_conn->dd_data; 2943 2943 struct iscsi_session *session = conn->session; 2944 - unsigned long flags; 2945 2944 2946 2945 del_timer_sync(&conn->transport_timer); 2947 2946 2947 + mutex_lock(&session->eh_mutex); 2948 2948 spin_lock_bh(&session->frwd_lock); 2949 2949 conn->c_stage = ISCSI_CONN_CLEANUP_WAIT; 2950 2950 if (session->leadconn == conn) { ··· 2955 2955 wake_up(&conn->ehwait); 2956 2956 } 2957 2957 spin_unlock_bh(&session->frwd_lock); 2958 - 2959 - /* 2960 - * Block until all in-progress commands for this connection 2961 - * time out or fail. 2962 - */ 2963 - for (;;) { 2964 - spin_lock_irqsave(session->host->host_lock, flags); 2965 - if (!atomic_read(&session->host->host_busy)) { /* OK for ERL == 0 */ 2966 - spin_unlock_irqrestore(session->host->host_lock, flags); 2967 - break; 2968 - } 2969 - spin_unlock_irqrestore(session->host->host_lock, flags); 2970 - msleep_interruptible(500); 2971 - iscsi_conn_printk(KERN_INFO, conn, "iscsi conn_destroy(): " 2972 - "host_busy %d host_failed %d\n", 2973 - atomic_read(&session->host->host_busy), 2974 - session->host->host_failed); 2975 - /* 2976 - * force eh_abort() to unblock 2977 - */ 2978 - wake_up(&conn->ehwait); 2979 - } 2980 2958 2981 2959 /* flush queued up work because we free the connection below */ 2982 2960 iscsi_suspend_tx(conn); ··· 2972 2994 if (session->leadconn == conn) 2973 2995 session->leadconn = NULL; 2974 2996 spin_unlock_bh(&session->frwd_lock); 2997 + mutex_unlock(&session->eh_mutex); 2975 2998 2976 2999 iscsi_destroy_conn(cls_conn); 2977 3000 }
+3 -3
drivers/scsi/sd.c
··· 2770 2770 max_xfer = sdkp->max_xfer_blocks; 2771 2771 max_xfer <<= ilog2(sdp->sector_size) - 9; 2772 2772 2773 - max_xfer = min_not_zero(queue_max_hw_sectors(sdkp->disk->queue), 2774 - max_xfer); 2775 - blk_queue_max_hw_sectors(sdkp->disk->queue, max_xfer); 2773 + sdkp->disk->queue->limits.max_sectors = 2774 + min_not_zero(queue_max_hw_sectors(sdkp->disk->queue), max_xfer); 2775 + 2776 2776 set_capacity(disk, sdkp->capacity); 2777 2777 sd_config_write_same(sdkp); 2778 2778 kfree(buffer);