lkml.org 
[lkml]   [2019]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] scsi:libiscsi: Hold back_lock when calling iscsi_complete_task
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>

\
 
 \ /
  Last update: 2019-03-08 02:49    [W:0.049 / U:1.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site