On 2/9/21 9:48 AM, Bodo Stroesser wrote: > On 09.02.21 13:38, Mike Christie wrote: >> +void target_queued_submit_work(struct work_struct *work) >> +{ >> + struct se_cmd_queue *sq = container_of(work, struct se_cmd_queue, work); >> + struct se_cmd *se_cmd, *next_cmd; >> + struct llist_node *cmd_list; >> + unsigned char *cdb; >> + >> + cmd_list = llist_del_all(&sq->cmd_list); >> + if (!cmd_list) >> + /* Previous call took what we were queued to submit */ >> + return; >> + >> + cmd_list = llist_reverse_order(cmd_list); >> + llist_for_each_entry_safe(se_cmd, next_cmd, cmd_list, se_cmd_list) { >> + cdb = se_cmd->se_tfo->get_cdb(se_cmd); > > If I got it right, get_cdb is a new, optional callback. > So, should we check, whether it is set? I think a check is not really useful. The caller has to implement it if they call target_queue_cmd_submit. It would be a BUG() and so either way you would get a crash when you are developing a patch. > > Maybe the check better could be done early in target_queue_cmd_submit. >