mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Nicholas Krause <xerofoify@gmail.com>, JBottomley@odin.com
Cc: martin.petersen@oracle.com, anish@chelsio.com, hare@suse.de,
	davem@davemloft.net, hariprasad@chelsio.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] csiostor:Fix locking issues in the function csio_scsim_cleanup_io_lnode
Date: Tue, 29 Dec 2015 11:27:42 -0700	[thread overview]
Message-ID: <5682D09E.2070700@kernel.dk> (raw)
In-Reply-To: <1451413394-21278-1-git-send-email-xerofoify@gmail.com>

On 12/29/2015 11:23 AM, Nicholas Krause wrote:
> This fixes locking issues in the function csio_scsim_cleanup_io_lnode
> by locking around the call to the function csio_csci_gather_active_ios
> with the function pair spin_lock_irq/spin_unlock_irq as any function
> calling this particular function must do in order to avoid concurrent
> threads of execution on the passed structure pointer of type csio_hw
> as this structure pointer can be shared across mutliple threads in the
> kernel.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>   drivers/scsi/csiostor/csio_scsi.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
> index 2c4562d..c318855 100644
> --- a/drivers/scsi/csiostor/csio_scsi.c
> +++ b/drivers/scsi/csiostor/csio_scsi.c
> @@ -1327,7 +1327,9 @@ csio_scsim_cleanup_io_lnode(struct csio_scsim *scm, struct csio_lnode *ln)
>   	sld.level = CSIO_LEV_LNODE;
>   	sld.lnode = ln;
>   	INIT_LIST_HEAD(&ln->cmpl_q);
> +	spin_lock_irq(&hw->lock);
>   	csio_scsi_gather_active_ios(scm, &sld, &ln->cmpl_q);
> +	spin_unlock_irq(&hw->lock);

All the callers grab that lock, you've just added a deadlock instead.

Nick, I've said this before and I'll say this again. Stop sending me 
patches. They are all untested and broken, you are wasting peoples time.

-- 
Jens Axboe


           reply	other threads:[~2015-12-29 18:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1451413394-21278-1-git-send-email-xerofoify@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5682D09E.2070700@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=JBottomley@odin.com \
    --cc=anish@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=hare@suse.de \
    --cc=hariprasad@chelsio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=xerofoify@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome