linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Leech <cleech@redhat.com>
To: Lee Duncan <lduncan@suse.com>
Cc: Lee Duncan <leeman.duncan@gmail.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	hare@suse.de
Subject: Re: [PATCH v2] scsi:libiscsi: Hold back_lock when calling iscsi_complete_task
Date: Thu, 7 Mar 2019 17:48:29 -0800	[thread overview]
Message-ID: <20190308014829.GD68002@straylight.hirudinean.org> (raw)
In-Reply-To: <88c1457c-7831-3341-1c63-11eb82244c4b@suse.com>

On Thu, Mar 07, 2019 at 05:37:50PM -0800, Lee Duncan wrote:
> On 3/6/19 10:23 AM, Chris Leech wrote:
> > On Mon, Feb 25, 2019 at 09:41:30AM -0800, Lee Duncan wrote:
> >> From: Lee Duncan <lduncan@suse.com>
> >>
> >> If there is an error queueing an iscsi command in
> >> iscsi_queuecommand(), for example if the transport fails
> >> to take the command in sessuin->tt->xmit_task(), then
> >> the error path can call iscsi_complete_task() without
> >> first aquiring the back_lock as required. This can
> >> lead to things like ITT pool can get corrupt, resulting
> >> in duplicate ITTs being sent out.
> >>
> >> The solution is to hold the back_lock around
> >> iscsi_complete_task() calls, and to add a little commenting
> >> to help others understand when back_lock must be held.
> >>
> >> Signed-off-by: Lee Duncan <lduncan@suse.com>
> >> ---
> > 
> > Lee,
> > 
> > Quick question, can you confirm that you tested this with lockdep?
> > 
> > It seems right to me, it's just that we've been hit with lockdep
> > problems dealing with these locks before.
> > 
> > - Chris
> 
> I'm glad you asked, to keep me honest -- I had not done it yet, because
> it seemed obvious to me.
> 
> But I did check today, and did not find any deadlock nor leaks. I was
> testing on a 5.0.0-1 kernel.

Thanks!

Acked-by: Chris Leech <cleech@redhat.com>


  reply	other threads:[~2019-03-08  1:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 17:41 [PATCH v2] scsi:libiscsi: Hold back_lock when calling iscsi_complete_task Lee Duncan
2019-03-06 18:23 ` Chris Leech
2019-03-08  1:37   ` Lee Duncan
2019-03-08  1:48     ` Chris Leech [this message]
2019-03-08  2:38 ` Martin K. Petersen

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=20190308014829.GD68002@straylight.hirudinean.org \
    --to=cleech@redhat.com \
    --cc=hare@suse.de \
    --cc=lduncan@suse.com \
    --cc=leeman.duncan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).