From: "Ewan D. Milne" <emilne@redhat.com>
To: Hannes Reinecke <hare@suse.com>
Cc: Jason Yan <yanaijie@huawei.com>,
Bart Van Assche <Bart.VanAssche@wdc.com>,
"hare@suse.de" <hare@suse.de>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"hch@lst.de" <hch@lst.de>,
"james.bottomley@hansenpartnership.com"
<james.bottomley@hansenpartnership.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: check for device state in __scsi_remove_target()
Date: Mon, 18 Dec 2017 09:38:21 -0500 [thread overview]
Message-ID: <1513607901.10760.101.camel@localhost.localdomain> (raw)
In-Reply-To: <1513289436.10760.79.camel@localhost.localdomain>
On Thu, 2017-12-14 at 17:10 -0500, Ewan D. Milne wrote:
> On Thu, 2017-12-14 at 10:02 +0100, Hannes Reinecke wrote:
> > On 12/14/2017 09:05 AM, Jason Yan wrote:
> > >
> > > On 2017/12/14 6:23, Bart Van Assche wrote:
> > >> On Wed, 2017-12-13 at 14:21 +0100, Hannes Reinecke wrote:
> > >>> As it turned out device_get() doesn't use kref_get_unless_zero(),
> > >>> so we will be always getting a device pointer.
> > >>> So we need to check for the device state in __scsi_remove_target()
> > >>> to avoid tripping over deleted objects.
> > >>>
> > >>> Fixes: fbce4d9 ("scsi: fixup kernel warning during rmmod()")
> > >>
> > >> How about adding Reported-by: Jason Yan? See also
> > >> https://www.spinics.net/lists/linux-scsi/msg115295.html
> > >>
> > >> Anyway:
> > >>
> > >> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
> > >>
> > >
> > > Seems the same as my patch.So how do we plan to fix this issue,
> > > pick this approach up or the approach James Bottomley suggested?
> > > I have sent a patch to change get_device() but Greg seems do not
> > > like this way.
> > >
> > This is actually a real regression, which can be trivially exercised by
> > eg logging out from two connections to an iSCSI target.
> > (Our QA tripped across that one).
> > So I'd rather have to have it fixed reasonably soon.
> >
> > While 'get_device' is IMO the 'correct' solution it surely warrants a
> > broader discussion, plus one would need to audit all callers to check
> > the return value. If we were going down that route we should probably
> > add a __must_check to get_device(), too.
> > But again, this will probably drag out for quite some time, and I'd
> > prefer to have the fix in the meantime.
> >
> > Cheers,
> >
> > Hannes
>
> We have 2 reproducible test cases, this patch fixes one of them,
> which was a continually oscillating FC target port w/short dev_loss_tmo.
> I'm still waiting for a report on the iSCSI test. The code looks good.
> We need to get some kind of fix for this sooner rather than later.
>
> Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Report here is that Hannes's patch fixes our failing iSCSI test also.
Martin/James, can we get this in please?
next prev parent reply other threads:[~2017-12-18 14:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 13:21 [PATCH] scsi: check for device state in __scsi_remove_target() Hannes Reinecke
2017-12-13 22:23 ` Bart Van Assche
2017-12-14 8:05 ` Jason Yan
2017-12-14 9:02 ` Hannes Reinecke
2017-12-14 22:10 ` Ewan D. Milne
2017-12-18 14:38 ` Ewan D. Milne [this message]
2017-12-19 3:37 ` Martin K. Petersen
2018-01-16 16:11 ` Bart Van Assche
2018-01-17 4:39 ` 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=1513607901.10760.101.camel@localhost.localdomain \
--to=emilne@redhat.com \
--cc=Bart.VanAssche@wdc.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=yanaijie@huawei.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