Thread (26 messages) 26 messages, 5 authors, 2018-07-31

Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

From: Kees Cook <hidden>
Date: 2018-05-22 23:50:03
Also in: linux-ide, linux-scsi, lkml

Possibly related (same subject, not in this thread)

On Tue, May 22, 2018 at 4:42 PM, Jens Axboe [off-list ref] wrote:
On May 22, 2018, at 5:31 PM, Kees Cook [off-list ref] wrote:
quoted
quoted
On Tue, May 22, 2018 at 12:16 PM, Jens Axboe [off-list ref] wrote:
quoted
On 5/22/18 1:13 PM, Christoph Hellwig wrote:
quoted
On Tue, May 22, 2018 at 01:09:41PM -0600, Jens Axboe wrote:
I think Martin and Christoph are objecting to moving the code to
block/scsi_ioctl.h. I don't care too much about where the code is, bu=
t
quoted
quoted
quoted
quoted
think it would be nice to have the definitions in a separate header. =
But
quoted
quoted
quoted
quoted
if they prefer just pulling in all of SCSI for it, well then I guess
it's pointless to move the header bits. Seems very heavy handed to me=
,
quoted
quoted
quoted
quoted
though.
It might be heavy handed for the 3 remaining users of drivers/ide,
Brutal :-)
Heh. I noticed a similar sense buffer use in drivers/cdrom/cdrom.c
too. Is this okay under the same considerations?
This is going from somewhat crazy to pretty nuts, imho. I guess in practi=
cal terms it doesn=E2=80=99t matter that much, since most folks would be us=
ing sr. I still think a split would be vastly superior. Just keep the scsi =
code in drivers/scsi/ and make it independently selectable.

I had originally tied it to BLK_SCSI_REQUEST. Logically speaking,
sense buffers are part of the request, and the CONFIG work is already
done. This is roughly what I tried to do before, since scsi_ioctl.c is
the only code pulled in for CONFIG_BLK_SCSI_REQUEST:

$ git grep BLK_SCSI_REQUEST | grep Makefile
block/Makefile:obj-$(CONFIG_BLK_SCSI_REQUEST)   +=3D scsi_ioctl.o

Should I move to code to a new drivers/scsi/scsi_sense.c and add it to
drivers/scsi/Makefile as:

obj-$(CONFIG_BLK_SCSI_REQUEST)    +=3D scsi_sense.o

Every place I want to use the code is already covered by
CONFIG_BLK_SCSI_REQUEST, so it seems like I just need to know where to
put the .c file. :P

-Kees

--=20
Kees Cook
Pixel Security
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help