From d7b35cc58fe2b6ca15ba24fb8cab6d274251585d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 29 Jul 2012 14:21:14 +0000 Subject: [PATCH] qla2x00t: Add a comment (merge r4418 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4437 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 13c3b00af..ddb6c1d9d 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -2447,6 +2447,11 @@ static inline int q2t_has_data(struct q2t_cmd *cmd) return cmd->bufflen > 0; } +/* + * Acquires pha->hardware lock and returns with the lock held when + * the result == SCST_TGT_RES_SUCCESS. The lock is unlocked if an + * error is returned. + */ static int q2t_pre_xmit_response(struct q2t_cmd *cmd, struct q2t_prm *prm, int xmit_type, unsigned long *flags) { @@ -2553,6 +2558,8 @@ static int q2t_pre_xmit_response(struct q2t_cmd *cmd, /* Does F/W have an IOCBs for this request */ res = q2t_check_reserve_free_req(ha, full_req_cnt); + + /* The following check must match the callers' assumptions */ if (unlikely(res != SCST_TGT_RES_SUCCESS)) goto out_unlock_free_unmap;