RE: [PATCH] bnx2:Make various functions to have a return type of void in the file bnx2.c

From: Sony Chacko
Date: Mon Jul 13 2015 - 14:46:19 EST


> Sony,
> I also sent this patch and was wondering if I can get a reply on it.
> From 4a607447562bec161fd947caae5eb02c2365c58a Mon Sep
> 17 00:00:00 2001
> From: Nicholas Krause <xerofoify@xxxxxxxxx>
> Date: Wed, 8 Jul 2015 08:29:07 -0400
> Subject: [PATCH] bnx2i:Fix backwards locking scenario in the
> function bnx2i_cleanup_task
>
> This fixes the backwards locking scenario for unlocking the
> bottom half spinlock before calling the
> wait_for_completion_timeout on the structure pointer
> bnx2i_conn's member cmd_cleanup_cmpl for the critical region
> of this function to lock the spin_lock bottom half before
> unlocking it after the call to this function in order to have actual
> protection for the function bnx2i_cleanup_task's critical region.
>
> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
> ---
> drivers/scsi/bnx2i/bnx2i_iscsi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> index 7289437..619a26f 100644
> --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> @@ -1172,12 +1172,12 @@ static void
> bnx2i_cleanup_task(struct iscsi_task *task)
> if (task->state == ISCSI_TASK_ABRT_TMF) {
> bnx2i_send_cmd_cleanup_req(hba, task->dd_data);
>
> - spin_unlock_bh(&conn->session->back_lock);
> - spin_unlock_bh(&conn->session->frwd_lock);
> + spin_lock_bh(&conn->session->back_lock);
> + spin_lock_bh(&conn->session->frwd_lock);
> wait_for_completion_timeout(&bnx2i_conn-
> >cmd_cleanup_cmpl,
>
> msecs_to_jiffies(ISCSI_CMD_CLEANUP_TIMEOUT));
> - spin_lock_bh(&conn->session->frwd_lock);
> - spin_lock_bh(&conn->session->back_lock);
> + spin_unlock_bh(&conn->session->frwd_lock);
> + spin_unlock_bh(&conn->session->back_lock);
> }
> bnx2i_iscsi_unmap_sg_list(task->dd_data);
> }
> --
> 2.1.4
> I am assuming it's wrong but you never known.
> Nick

Nick,

I have included the Qlogic ISCSI engineer to the mailing list to
review and ACK the patch. I will also follow it up with the
ISCSI team.

Thanks,
Sony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/