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 git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull more scsi target fixes from Nicholas Bellinger:
"This series is a second round of target fixes for v3.7-rc4 that have
come into target-devel over the last days, and are important enough to
be applied ASAP.

All are being CC'ed to stable. The most important two are:

- target: Re-add explict zeroing of INQUIRY bounce buffer memory to
fix a regression for handling zero-length payloads, a bug that went
during v3.7-rc1, and hit >= v3.6.3 stable. (nab + paolo)

- iscsi-target: Fix a long-standing missed R2T wakeup race in TX
thread processing when using a single queue slot. (Roland)

Thanks to Roland & PureStorage team for helping to track down this
long standing race with iscsi-target single queue slot operation.

Also, the tcm_fc(FCoE) regression bug that was observed recently with
-rc2 code has also been resolved with the cancel_delayed_work() return
bugfix (commit c0158ca64da5: "workqueue: cancel_delayed_work() should
return %false if work item is idle") now in -rc3. Thanks again to Yi
Zou, MDR, Robert Love @ Intel for helping to track this down."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target: Fix incorrect usage of nested IRQ spinlocks in ABORT_TASK path
iscsi-target: Fix missed wakeup race in TX thread
target: Avoid integer overflow in se_dev_align_max_sectors()
target: Don't return success from module_init() if setup fails
target: Re-add explict zeroing of INQUIRY bounce buffer memory

+42 -16
+3 -1
drivers/target/iscsi/iscsi_target.c
··· 3719 3719 */ 3720 3720 iscsit_thread_check_cpumask(conn, current, 1); 3721 3721 3722 - schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT); 3722 + wait_event_interruptible(conn->queues_wq, 3723 + !iscsit_conn_all_queues_empty(conn) || 3724 + ts->status == ISCSI_THREAD_SET_RESET); 3723 3725 3724 3726 if ((ts->status == ISCSI_THREAD_SET_RESET) || 3725 3727 signal_pending(current))
+1
drivers/target/iscsi/iscsi_target_core.h
··· 486 486 }; 487 487 488 488 struct iscsi_conn { 489 + wait_queue_head_t queues_wq; 489 490 /* Authentication Successful for this connection */ 490 491 u8 auth_complete; 491 492 /* State connection is currently in */
+1
drivers/target/iscsi/iscsi_target_login.c
··· 41 41 42 42 static int iscsi_login_init_conn(struct iscsi_conn *conn) 43 43 { 44 + init_waitqueue_head(&conn->queues_wq); 44 45 INIT_LIST_HEAD(&conn->conn_list); 45 46 INIT_LIST_HEAD(&conn->conn_cmd_list); 46 47 INIT_LIST_HEAD(&conn->immed_queue_list);
+20 -2
drivers/target/iscsi/iscsi_target_util.c
··· 488 488 atomic_set(&conn->check_immediate_queue, 1); 489 489 spin_unlock_bh(&conn->immed_queue_lock); 490 490 491 - wake_up_process(conn->thread_set->tx_thread); 491 + wake_up(&conn->queues_wq); 492 492 } 493 493 494 494 struct iscsi_queue_req *iscsit_get_cmd_from_immediate_queue(struct iscsi_conn *conn) ··· 562 562 atomic_inc(&cmd->response_queue_count); 563 563 spin_unlock_bh(&conn->response_queue_lock); 564 564 565 - wake_up_process(conn->thread_set->tx_thread); 565 + wake_up(&conn->queues_wq); 566 566 } 567 567 568 568 struct iscsi_queue_req *iscsit_get_cmd_from_response_queue(struct iscsi_conn *conn) ··· 614 614 cmd->init_task_tag, 615 615 atomic_read(&cmd->response_queue_count)); 616 616 } 617 + } 618 + 619 + bool iscsit_conn_all_queues_empty(struct iscsi_conn *conn) 620 + { 621 + bool empty; 622 + 623 + spin_lock_bh(&conn->immed_queue_lock); 624 + empty = list_empty(&conn->immed_queue_list); 625 + spin_unlock_bh(&conn->immed_queue_lock); 626 + 627 + if (!empty) 628 + return empty; 629 + 630 + spin_lock_bh(&conn->response_queue_lock); 631 + empty = list_empty(&conn->response_queue_list); 632 + spin_unlock_bh(&conn->response_queue_lock); 633 + 634 + return empty; 617 635 } 618 636 619 637 void iscsit_free_queue_reqs_for_conn(struct iscsi_conn *conn)
+1
drivers/target/iscsi/iscsi_target_util.h
··· 25 25 extern void iscsit_add_cmd_to_response_queue(struct iscsi_cmd *, struct iscsi_conn *, u8); 26 26 extern struct iscsi_queue_req *iscsit_get_cmd_from_response_queue(struct iscsi_conn *); 27 27 extern void iscsit_remove_cmd_from_tx_queues(struct iscsi_cmd *, struct iscsi_conn *); 28 + extern bool iscsit_conn_all_queues_empty(struct iscsi_conn *); 28 29 extern void iscsit_free_queue_reqs_for_conn(struct iscsi_conn *); 29 30 extern void iscsit_release_cmd(struct iscsi_cmd *); 30 31 extern void iscsit_free_cmd(struct iscsi_cmd *);
+2 -1
drivers/target/target_core_configfs.c
··· 3206 3206 if (ret < 0) 3207 3207 goto out; 3208 3208 3209 - if (core_dev_setup_virtual_lun0() < 0) 3209 + ret = core_dev_setup_virtual_lun0(); 3210 + if (ret < 0) 3210 3211 goto out; 3211 3212 3212 3213 return 0;
+9 -9
drivers/target/target_core_device.c
··· 850 850 851 851 static u32 se_dev_align_max_sectors(u32 max_sectors, u32 block_size) 852 852 { 853 - u32 tmp, aligned_max_sectors; 853 + u32 aligned_max_sectors; 854 + u32 alignment; 854 855 /* 855 856 * Limit max_sectors to a PAGE_SIZE aligned value for modern 856 857 * transport_allocate_data_tasks() operation. 857 858 */ 858 - tmp = rounddown((max_sectors * block_size), PAGE_SIZE); 859 - aligned_max_sectors = (tmp / block_size); 860 - if (max_sectors != aligned_max_sectors) { 861 - printk(KERN_INFO "Rounding down aligned max_sectors from %u" 862 - " to %u\n", max_sectors, aligned_max_sectors); 863 - return aligned_max_sectors; 864 - } 859 + alignment = max(1ul, PAGE_SIZE / block_size); 860 + aligned_max_sectors = rounddown(max_sectors, alignment); 865 861 866 - return max_sectors; 862 + if (max_sectors != aligned_max_sectors) 863 + pr_info("Rounding down aligned max_sectors from %u to %u\n", 864 + max_sectors, aligned_max_sectors); 865 + 866 + return aligned_max_sectors; 867 867 } 868 868 869 869 void se_dev_set_default_attribs(
+2
drivers/target/target_core_spc.c
··· 605 605 unsigned char buf[SE_INQUIRY_BUF]; 606 606 int p, ret; 607 607 608 + memset(buf, 0, SE_INQUIRY_BUF); 609 + 608 610 if (dev == tpg->tpg_virt_lun0.lun_se_dev) 609 611 buf[0] = 0x3f; /* Not connected */ 610 612 else
+3 -3
drivers/target/target_core_tmr.c
··· 140 140 printk("ABORT_TASK: Found referenced %s task_tag: %u\n", 141 141 se_cmd->se_tfo->get_fabric_name(), ref_tag); 142 142 143 - spin_lock_irq(&se_cmd->t_state_lock); 143 + spin_lock(&se_cmd->t_state_lock); 144 144 if (se_cmd->transport_state & CMD_T_COMPLETE) { 145 145 printk("ABORT_TASK: ref_tag: %u already complete, skipping\n", ref_tag); 146 - spin_unlock_irq(&se_cmd->t_state_lock); 146 + spin_unlock(&se_cmd->t_state_lock); 147 147 spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); 148 148 goto out; 149 149 } 150 150 se_cmd->transport_state |= CMD_T_ABORTED; 151 - spin_unlock_irq(&se_cmd->t_state_lock); 151 + spin_unlock(&se_cmd->t_state_lock); 152 152 153 153 list_del_init(&se_cmd->se_cmd_list); 154 154 kref_get(&se_cmd->cmd_kref);