Mike Christie <michael.christie@oracle.com> says: The following patches apply over Martin's 6.4 branches and Linus's tree. They fix a couple regressions in iscsit that occur when there are TMRs executing and a connection is closed. It also includes Dimitry's fixes in related code paths for cmd cleanup when ERL2 is used and the write pending hang during conn cleanup. This version of the patchset brings it back to just regressions and fixes for bugs we have a lot of users hitting. I'm going to fix isert and get it hooked into iscsit properly in a second patchset, because this one was getting so large. I've also moved my cleanup type of patches for a 3rd patchset.
Showing the changes to include/target (3 of 13 files). Show all
Unified · Split
| @@ -600,6 +600,7 @@ struct iscsit_conn { · 599 unmodified lines | |||
| 600 | struct iscsi_tpg_np *tpg_np; | 600 | struct iscsi_tpg_np *tpg_np; |
| 601 | /* Pointer to parent session */ | 601 | /* Pointer to parent session */ |
| 602 | struct iscsit_session *sess; | 602 | struct iscsit_session *sess; |
| 603 | struct target_cmd_counter *cmd_cnt; | ||
| 603 | int bitmap_id; | 604 | int bitmap_id; |
| 604 | int rx_thread_active; | 605 | int rx_thread_active; |
| 605 | struct task_struct *rx_thread; | 606 | struct task_struct *rx_thread; |
| @@ -494,6 +494,7 @@ struct se_cmd { · 493 unmodified lines | |||
| 494 | struct se_lun *se_lun; | 494 | struct se_lun *se_lun; |
| 495 | /* Only used for internal passthrough and legacy TCM fabric modules */ | 495 | /* Only used for internal passthrough and legacy TCM fabric modules */ |
| 496 | struct se_session *se_sess; | 496 | struct se_session *se_sess; |
| 497 | struct target_cmd_counter *cmd_cnt; | ||
| 497 | struct se_tmr_req *se_tmr_req; | 498 | struct se_tmr_req *se_tmr_req; |
| 498 | struct llist_node se_cmd_list; | 499 | struct llist_node se_cmd_list; |
| 499 | struct completion *free_compl; | 500 | struct completion *free_compl; |
| @@ -619,22 +620,26 @@ static inline struct se_node_acl *fabric_stat_to_nacl(struct config_item *item) · 119 unmodified lines | |||
| 619 | acl_fabric_stat_group); | 620 | acl_fabric_stat_group); |
| 620 | } | 621 | } |
| 621 | 622 | ||
| 622 | struct se_session { | 623 | struct target_cmd_counter { |
| 624 | struct percpu_ref refcnt; | ||
| 625 | wait_queue_head_t refcnt_wq; | ||
| 626 | struct completion stop_done; | ||
| 623 | atomic_t stopped; | 627 | atomic_t stopped; |
| 628 | }; | ||
| 629 | |||
| 630 | struct se_session { | ||
| 624 | u64 sess_bin_isid; | 631 | u64 sess_bin_isid; |
| 625 | enum target_prot_op sup_prot_ops; | 632 | enum target_prot_op sup_prot_ops; |
| 626 | enum target_prot_type sess_prot_type; | 633 | enum target_prot_type sess_prot_type; |
| 627 | struct se_node_acl *se_node_acl; | 634 | struct se_node_acl *se_node_acl; |
| 628 | struct se_portal_group *se_tpg; | 635 | struct se_portal_group *se_tpg; |
| 629 | void *fabric_sess_ptr; | 636 | void *fabric_sess_ptr; |
| 630 | struct percpu_ref cmd_count; | ||
| 631 | struct list_head sess_list; | 637 | struct list_head sess_list; |
| 632 | struct list_head sess_acl_list; | 638 | struct list_head sess_acl_list; |
| 633 | spinlock_t sess_cmd_lock; | 639 | spinlock_t sess_cmd_lock; |
| 634 | wait_queue_head_t cmd_count_wq; | ||
| 635 | struct completion stop_done; | ||
| 636 | void *sess_cmd_map; | 640 | void *sess_cmd_map; |
| 637 | struct sbitmap_queue sess_tag_pool; | 641 | struct sbitmap_queue sess_tag_pool; |
| 642 | struct target_cmd_counter *cmd_cnt; | ||
| 638 | }; | 643 | }; |
| 639 | 644 | ||
| 640 | struct se_device; | 645 | struct se_device; |
| @@ -863,6 +868,7 @@ struct se_device { · 222 unmodified lines | |||
| 863 | struct rcu_head rcu_head; | 868 | struct rcu_head rcu_head; |
| 864 | int queue_cnt; | 869 | int queue_cnt; |
| 865 | struct se_device_queue *queues; | 870 | struct se_device_queue *queues; |
| 871 | struct mutex lun_reset_mutex; | ||
| 866 | }; | 872 | }; |
| 867 | 873 | ||
| 868 | struct target_opcode_descriptor { | 874 | struct target_opcode_descriptor { |
| @@ -133,7 +133,12 @@ struct se_session *target_setup_session(struct se_portal_group *, · 132 unmodified lines | |||
| 133 | struct se_session *, void *)); | 133 | struct se_session *, void *)); |
| 134 | void target_remove_session(struct se_session *); | 134 | void target_remove_session(struct se_session *); |
| 135 | 135 | ||
| 136 | int transport_init_session(struct se_session *se_sess); | 136 | void target_stop_cmd_counter(struct target_cmd_counter *cmd_cnt); |
| 137 | void target_wait_for_cmds(struct target_cmd_counter *cmd_cnt); | ||
| 138 | struct target_cmd_counter *target_alloc_cmd_counter(void); | ||
| 139 | void target_free_cmd_counter(struct target_cmd_counter *cmd_cnt); | ||
| 140 | |||
| 141 | void transport_init_session(struct se_session *se_sess); | ||
| 137 | struct se_session *transport_alloc_session(enum target_prot_op); | 142 | struct se_session *transport_alloc_session(enum target_prot_op); |
| 138 | int transport_alloc_session_tags(struct se_session *, unsigned int, | 143 | int transport_alloc_session_tags(struct se_session *, unsigned int, |
| 139 | unsigned int); | 144 | unsigned int); |
| @@ -149,9 +154,11 @@ void transport_deregister_session_configfs(struct se_session *); · 9 unmodified lines | |||
| 149 | void transport_deregister_session(struct se_session *); | 154 | void transport_deregister_session(struct se_session *); |
| 150 | 155 | ||
| 151 | 156 | ||
| 152 | void __target_init_cmd(struct se_cmd *, | 157 | void __target_init_cmd(struct se_cmd *cmd, |
| 153 | const struct target_core_fabric_ops *, | 158 | const struct target_core_fabric_ops *tfo, |
| 154 | struct se_session *, u32, int, int, unsigned char *, u64); | 159 | struct se_session *sess, u32 data_length, int data_direction, |
| 160 | int task_attr, unsigned char *sense_buffer, u64 unpacked_lun, | ||
| 161 | struct target_cmd_counter *cmd_cnt); | ||
| 155 | int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, | 162 | int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, |
| 156 | unsigned char *sense, u64 unpacked_lun, u32 data_length, | 163 | unsigned char *sense, u64 unpacked_lun, u32 data_length, |
| 157 | int task_attr, int data_dir, int flags); | 164 | int task_attr, int data_dir, int flags); |