lkml.org 
[lkml]   [2011]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] SCSI IOCTL: Check for device deletion [was Re: __elv_add_request OOPS]
From
Date
On Wed, 2011-05-25 at 13:03 -0700, Linus Torvalds wrote:
> On Wed, May 25, 2011 at 12:52 PM, Parag Warudkar <parag.lkml@gmail.com> wrote:
> >
> > +static inline int sdev_early_check(struct scsi_device *sdev)
> > +{
> > + if (!sdev || sdev->sdev_state == SDEV_DEL
> > + || sdev->sdev_state > SDEV_QUIESCE)
> > + return -ENXIO;
> > + return 0;
> > +}
>
> Can somebody explain why it's those states, and nothing else?

The states are definitely wrong. QUIESCE shouldn't cause an error.

Can we back up a bit. I agree with Jens that sdev->request_queue looks
to be NULL, but that *only* happens in the final sdev release, so this
must be a refcounting problem higher up the stack. Something is holding
an unrefcounted pointer to the sdev.

James




\
 
 \ /
  Last update: 2011-05-25 22:23    [W:4.645 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site