Re: [PATCH] SCSI IOCTL: Check for device deletion [was Re:__elv_add_request OOPS]

From: Linus Torvalds
Date: Wed May 25 2011 - 14:56:54 EST


On Wed, May 25, 2011 at 11:44 AM, Parag Warudkar <parag.lkml@xxxxxxxxx> wrote:
>
> Below patch pushes the check down to ioctl functions and hopefully should
> cover more ioctl-on-gone-device cases by returning -ENXIO if an attempt
> was made to submit request to a non-running device.

Can we please not duplicate complicated logic like that?

IOW, just make a helper function for it.

That said, isn't this all *exactly* what scsi_prep_state_check() is
supposed to check for? Why isn't that called, or if called, why isn't
it doing the right thing?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/