History

Merge patch series "target: TMF and recovery fixes"

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.

Martin K. Petersen committed 3 years ago

Commit ae2fb3c2 parents 5c8c74e ea8798113 files · +230 −118Browse files

Showing the changes to include/target (3 of 13 files). Show all

Unified · Split

3 files
  1. include/target/iscsi/iscsi_target_core.h +1 −0
  2. include/target/target_core_base.h +10 −4
  3. include/target/target_core_fabric.h +11 −4
include/target/iscsi/iscsi_target_core.h+1−0
@@ -600,6 +600,7 @@ struct iscsit_conn { · 599 unmodified lines
600600 struct iscsi_tpg_np *tpg_np;
601601 /* Pointer to parent session */
602602 struct iscsit_session *sess;
603+ struct target_cmd_counter *cmd_cnt;
603604 int bitmap_id;
604605 int rx_thread_active;
605606 struct task_struct *rx_thread;
include/target/target_core_base.h+10−4
@@ -494,6 +494,7 @@ struct se_cmd { · 493 unmodified lines
494494 struct se_lun *se_lun;
495495 /* Only used for internal passthrough and legacy TCM fabric modules */
496496 struct se_session *se_sess;
497+ struct target_cmd_counter *cmd_cnt;
497498 struct se_tmr_req *se_tmr_req;
498499 struct llist_node se_cmd_list;
499500 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
619620 acl_fabric_stat_group);
620621 }
621622
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;
623627 atomic_t stopped;
628+};
629+
630+struct se_session {
624631 u64 sess_bin_isid;
625632 enum target_prot_op sup_prot_ops;
626633 enum target_prot_type sess_prot_type;
627634 struct se_node_acl *se_node_acl;
628635 struct se_portal_group *se_tpg;
629636 void *fabric_sess_ptr;
630− struct percpu_ref cmd_count;
631637 struct list_head sess_list;
632638 struct list_head sess_acl_list;
633639 spinlock_t sess_cmd_lock;
634− wait_queue_head_t cmd_count_wq;
635− struct completion stop_done;
636640 void *sess_cmd_map;
637641 struct sbitmap_queue sess_tag_pool;
642+ struct target_cmd_counter *cmd_cnt;
638643 };
639644
640645 struct se_device;
@@ -863,6 +868,7 @@ struct se_device { · 222 unmodified lines
863868 struct rcu_head rcu_head;
864869 int queue_cnt;
865870 struct se_device_queue *queues;
871+ struct mutex lun_reset_mutex;
866872 };
867873
868874 struct target_opcode_descriptor {
include/target/target_core_fabric.h+11−4
@@ -133,7 +133,12 @@ struct se_session *target_setup_session(struct se_portal_group *, · 132 unmodified lines
133133 struct se_session *, void *));
134134 void target_remove_session(struct se_session *);
135135
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);
137142 struct se_session *transport_alloc_session(enum target_prot_op);
138143 int transport_alloc_session_tags(struct se_session *, unsigned int,
139144 unsigned int);
@@ -149,9 +154,11 @@ void transport_deregister_session_configfs(struct se_session *); · 9 unmodified lines
149154 void transport_deregister_session(struct se_session *);
150155
151156
152−void __target_init_cmd(struct se_cmd *,
153− const struct target_core_fabric_ops *,
154− struct se_session *, u32, int, int, unsigned char *, u64);
157+void __target_init_cmd(struct se_cmd *cmd,
158+ const struct target_core_fabric_ops *tfo,
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);
155162 int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
156163 unsigned char *sense, u64 unpacked_lun, u32 data_length,
157164 int task_attr, int data_dir, int flags);