From: Kashyap Desai <kashyap.desai@broadcom.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: RE: out of range LBA using sg_raw
Date: Wed, 8 Mar 2017 21:41:48 +0530 [thread overview]
Message-ID: <a408113afc010cb987d384dc78800f74@mail.gmail.com> (raw)
In-Reply-To: <20170308160633.GA25913@infradead.org>
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@infradead.org]
> Sent: Wednesday, March 08, 2017 9:37 PM
> To: Kashyap Desai
> Cc: Christoph Hellwig; linux-kernel@vger.kernel.org; linux-
> scsi@vger.kernel.org
> Subject: Re: out of range LBA using sg_raw
>
> On Wed, Mar 08, 2017 at 09:29:28PM +0530, Kashyap Desai wrote:
> > Thanks Chris. It is understood to have sanity in driver, but how
> > critical such checks where SG_IO type interface send pass-through
request.
> ?
> > Are you suggesting as good to have sanity or very important as there
> > may be a real-time exposure other than SG_IO interface ? I am confused
> > over must or good to have check.
> > Also one more fault I can generate using below sg_raw command -
>
> SCSI _devices_ need to sanity check any input and fail commands instead
of
> crashing or causing other problems. Normal SCSI HBA drivers don't need
to
> do that as they don't interpret CDBs. Megaraid (and a few other raid
drivers)
> are special in that they take on part of the device functionality and do
> interpret CDBs sometimes. In that case you'll need to do all that
sanity
> checking and generate proper errors.
>
> It would be nice to have come common helpers for this shared between
> everyone interpreting SCSI CBD (e.g. the SCSI target code, the NVMe SCSI
> emulation and the various RAID drivers).
Thanks Chris. I will continue on this and will come back with changes.
Let me check with Broadcom internally and figure out all possible
scenarios for megaraid_sas.
Thanks, Kashyap
next prev parent reply other threads:[~2017-03-08 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 14:21 out of range LBA using sg_raw Kashyap Desai
2017-03-08 15:11 ` Christoph Hellwig
2017-03-08 15:59 ` Kashyap Desai
2017-03-08 16:04 ` Bart Van Assche
2017-03-08 16:15 ` Kashyap Desai
2017-03-08 16:06 ` Christoph Hellwig
2017-03-08 16:11 ` Kashyap Desai [this message]
2017-03-08 16:32 ` Martin K. Petersen
2017-03-08 16:49 ` Kashyap Desai
2017-03-09 0:40 ` 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=a408113afc010cb987d384dc78800f74@mail.gmail.com \
--to=kashyap.desai@broadcom.com \
--cc=hch@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.