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:
"Four non-core fixes.

Two are reverts of target fixes which turned out to have unwanted side
effects, one is a revert of an RDMA fix with the same problem and the
final one fixes an incorrect warning about memory allocation failures
in megaraid_sas (the driver actually reduces the allocation size until
it succeeds)"

Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session"
scsi: Revert "RDMA/isert: Fix a recently introduced regression related to logout"
scsi: megaraid_sas: silence a warning
scsi: Revert "target/core: Inline transport_lun_remove_cmd()"

+48 -17
+12
drivers/infiniband/ulp/isert/ib_isert.c
··· 2575 2575 } 2576 2576 } 2577 2577 2578 + static void 2579 + isert_wait4cmds(struct iscsi_conn *conn) 2580 + { 2581 + isert_info("iscsi_conn %p\n", conn); 2582 + 2583 + if (conn->sess) { 2584 + target_sess_cmd_list_set_waiting(conn->sess->se_sess); 2585 + target_wait_for_sess_cmds(conn->sess->se_sess); 2586 + } 2587 + } 2588 + 2578 2589 /** 2579 2590 * isert_put_unsol_pending_cmds() - Drop commands waiting for 2580 2591 * unsolicitate dataout ··· 2633 2622 2634 2623 ib_drain_qp(isert_conn->qp); 2635 2624 isert_put_unsol_pending_cmds(conn); 2625 + isert_wait4cmds(conn); 2636 2626 isert_wait4logout(isert_conn); 2637 2627 2638 2628 queue_work(isert_release_wq, &isert_conn->release_work);
+3 -2
drivers/scsi/megaraid/megaraid_sas_fusion.c
··· 623 623 624 624 fusion->io_request_frames = 625 625 dma_pool_alloc(fusion->io_request_frames_pool, 626 - GFP_KERNEL, &fusion->io_request_frames_phys); 626 + GFP_KERNEL | __GFP_NOWARN, 627 + &fusion->io_request_frames_phys); 627 628 if (!fusion->io_request_frames) { 628 629 if (instance->max_fw_cmds >= (MEGASAS_REDUCE_QD_COUNT * 2)) { 629 630 instance->max_fw_cmds -= MEGASAS_REDUCE_QD_COUNT; ··· 662 661 663 662 fusion->io_request_frames = 664 663 dma_pool_alloc(fusion->io_request_frames_pool, 665 - GFP_KERNEL, 664 + GFP_KERNEL | __GFP_NOWARN, 666 665 &fusion->io_request_frames_phys); 667 666 668 667 if (!fusion->io_request_frames) {
+5 -11
drivers/target/iscsi/iscsi_target.c
··· 1165 1165 hdr->cmdsn, be32_to_cpu(hdr->data_length), payload_length, 1166 1166 conn->cid); 1167 1167 1168 - if (target_get_sess_cmd(&cmd->se_cmd, true) < 0) 1169 - return iscsit_add_reject_cmd(cmd, 1170 - ISCSI_REASON_WAITING_FOR_LOGOUT, buf); 1168 + target_get_sess_cmd(&cmd->se_cmd, true); 1171 1169 1172 1170 cmd->sense_reason = transport_lookup_cmd_lun(&cmd->se_cmd, 1173 1171 scsilun_to_int(&hdr->lun)); ··· 2002 2004 conn->sess->se_sess, 0, DMA_NONE, 2003 2005 TCM_SIMPLE_TAG, cmd->sense_buffer + 2); 2004 2006 2005 - if (target_get_sess_cmd(&cmd->se_cmd, true) < 0) 2006 - return iscsit_add_reject_cmd(cmd, 2007 - ISCSI_REASON_WAITING_FOR_LOGOUT, buf); 2007 + target_get_sess_cmd(&cmd->se_cmd, true); 2008 2008 2009 2009 /* 2010 2010 * TASK_REASSIGN for ERL=2 / connection stays inside of ··· 4145 4149 iscsit_stop_nopin_response_timer(conn); 4146 4150 iscsit_stop_nopin_timer(conn); 4147 4151 4152 + if (conn->conn_transport->iscsit_wait_conn) 4153 + conn->conn_transport->iscsit_wait_conn(conn); 4154 + 4148 4155 /* 4149 4156 * During Connection recovery drop unacknowledged out of order 4150 4157 * commands for this connection, and prepare the other commands ··· 4230 4231 * must wait until they have completed. 4231 4232 */ 4232 4233 iscsit_check_conn_usage_count(conn); 4233 - target_sess_cmd_list_set_waiting(sess->se_sess); 4234 - target_wait_for_sess_cmds(sess->se_sess); 4235 - 4236 - if (conn->conn_transport->iscsit_wait_conn) 4237 - conn->conn_transport->iscsit_wait_conn(conn); 4238 4234 4239 4235 ahash_request_free(conn->conn_tx_hash); 4240 4236 if (conn->conn_rx_hash) {
+28 -3
drivers/target/target_core_transport.c
··· 666 666 667 667 target_remove_from_state_list(cmd); 668 668 669 + /* 670 + * Clear struct se_cmd->se_lun before the handoff to FE. 671 + */ 672 + cmd->se_lun = NULL; 673 + 669 674 spin_lock_irqsave(&cmd->t_state_lock, flags); 670 675 /* 671 676 * Determine if frontend context caller is requesting the stopping of ··· 696 691 * passed is released at this point, or zero if not being released. 697 692 */ 698 693 return cmd->se_tfo->check_stop_free(cmd); 694 + } 695 + 696 + static void transport_lun_remove_cmd(struct se_cmd *cmd) 697 + { 698 + struct se_lun *lun = cmd->se_lun; 699 + 700 + if (!lun) 701 + return; 702 + 703 + if (cmpxchg(&cmd->lun_ref_active, true, false)) 704 + percpu_ref_put(&lun->lun_ref); 699 705 } 700 706 701 707 static void target_complete_failure_work(struct work_struct *work) ··· 798 782 } 799 783 800 784 WARN_ON_ONCE(kref_read(&cmd->cmd_kref) == 0); 785 + 786 + transport_lun_remove_cmd(cmd); 801 787 802 788 transport_cmd_check_stop_to_fabric(cmd); 803 789 } ··· 1726 1708 se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; 1727 1709 se_cmd->se_tfo->queue_tm_rsp(se_cmd); 1728 1710 1711 + transport_lun_remove_cmd(se_cmd); 1729 1712 transport_cmd_check_stop_to_fabric(se_cmd); 1730 1713 } 1731 1714 ··· 1917 1898 goto queue_full; 1918 1899 1919 1900 check_stop: 1901 + transport_lun_remove_cmd(cmd); 1920 1902 transport_cmd_check_stop_to_fabric(cmd); 1921 1903 return; 1922 1904 ··· 2215 2195 transport_handle_queue_full(cmd, cmd->se_dev, ret, false); 2216 2196 return; 2217 2197 } 2198 + transport_lun_remove_cmd(cmd); 2218 2199 transport_cmd_check_stop_to_fabric(cmd); 2219 2200 } 2220 2201 ··· 2310 2289 if (ret) 2311 2290 goto queue_full; 2312 2291 2292 + transport_lun_remove_cmd(cmd); 2313 2293 transport_cmd_check_stop_to_fabric(cmd); 2314 2294 return; 2315 2295 } ··· 2336 2314 if (ret) 2337 2315 goto queue_full; 2338 2316 2317 + transport_lun_remove_cmd(cmd); 2339 2318 transport_cmd_check_stop_to_fabric(cmd); 2340 2319 return; 2341 2320 } ··· 2372 2349 if (ret) 2373 2350 goto queue_full; 2374 2351 2352 + transport_lun_remove_cmd(cmd); 2375 2353 transport_cmd_check_stop_to_fabric(cmd); 2376 2354 return; 2377 2355 } ··· 2408 2384 break; 2409 2385 } 2410 2386 2387 + transport_lun_remove_cmd(cmd); 2411 2388 transport_cmd_check_stop_to_fabric(cmd); 2412 2389 return; 2413 2390 ··· 2735 2710 */ 2736 2711 if (cmd->state_active) 2737 2712 target_remove_from_state_list(cmd); 2713 + 2714 + if (cmd->se_lun) 2715 + transport_lun_remove_cmd(cmd); 2738 2716 } 2739 2717 if (aborted) 2740 2718 cmd->free_compl = &compl; ··· 2808 2780 struct completion *free_compl = se_cmd->free_compl; 2809 2781 struct completion *abrt_compl = se_cmd->abrt_compl; 2810 2782 unsigned long flags; 2811 - 2812 - if (se_cmd->lun_ref_active) 2813 - percpu_ref_put(&se_cmd->se_lun->lun_ref); 2814 2783 2815 2784 if (se_sess) { 2816 2785 spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
-1
include/scsi/iscsi_proto.h
··· 627 627 #define ISCSI_REASON_BOOKMARK_INVALID 9 628 628 #define ISCSI_REASON_BOOKMARK_NO_RESOURCES 10 629 629 #define ISCSI_REASON_NEGOTIATION_RESET 11 630 - #define ISCSI_REASON_WAITING_FOR_LOGOUT 12 631 630 632 631 /* Max. number of Key=Value pairs in a text message */ 633 632 #define MAX_KEY_VALUE_PAIRS 8192