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
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;
include/target/target_core_base.h+10−4
@@ -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
622struct se_session {623struct 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
630struct 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
640struct se_device;645struct 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
868struct target_opcode_descriptor {874struct 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
133 struct se_session *, void *));133 struct se_session *, void *));
134void target_remove_session(struct se_session *);134void target_remove_session(struct se_session *);
135 135
136int transport_init_session(struct se_session *se_sess);136void target_stop_cmd_counter(struct target_cmd_counter *cmd_cnt);
137void target_wait_for_cmds(struct target_cmd_counter *cmd_cnt);
138struct target_cmd_counter *target_alloc_cmd_counter(void);
139void target_free_cmd_counter(struct target_cmd_counter *cmd_cnt);
140
141void transport_init_session(struct se_session *se_sess);
137struct se_session *transport_alloc_session(enum target_prot_op);142struct se_session *transport_alloc_session(enum target_prot_op);
138int transport_alloc_session_tags(struct se_session *, unsigned int,143int 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
149void transport_deregister_session(struct se_session *);154void transport_deregister_session(struct se_session *);
150 155
151 156
152void __target_init_cmd(struct se_cmd *,157void __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);
155int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,162int 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);