From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: Kernel Developer List <linux-kernel@vger.kernel.org>,
Linux SCSI list <linux-scsi@vger.kernel.org>
Subject: error in drivers/block/scsi_ioctl.c and ll_rw_block.c?
Date: Sun, 28 Sep 2003 16:02:38 -0700 [thread overview]
Message-ID: <20030928160238.A18507@one-eyed-alien.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
While working on usb-storage (a virtual SCSI HBA), I noticed that the
command 'eject /dev/scd0' sent a START_STOP command to the device with the
data direction set to SCSI_DATA_WRITE but a transfer length of zero. This
causes a problem for some code paths.
For clarity, the START_STOP command doesn't want to move any data at all.
It looks to me like the error is a combination of
drivers/block/scsi_ioctl.c and ll_rw_block.c
scsi_ioctl.c calls blk_get_request(q, WRITE, __GFP_WAIT) to allocate the
request -- specifying WRITE here is one problem.
In ll_rw_block.c, blk_get_request() calls BUG_ON(rq != READ && rw != WRITE)
-- in other words, it can only allocate a request for reading or writing,
but not for no data. I'm not familiar with this code, but it looks like
requests are tracked by data direction, so making this accept NONE may be
difficult.
One possible solution may be to re-write the CDROMEJECT ioctl into a call
to sg_scsi_ioctl(), but that doesn't fix the general problem with
ll_rw_block.c -- if, indeed, that is a problem.
Matt
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
It's not that hard. No matter what the problem is, tell the customer
to reinstall Windows.
-- Nurse
User Friendly, 3/22/1998
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
next reply other threads:[~2003-09-28 23:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-28 23:02 Matthew Dharm [this message]
2003-09-29 7:51 ` error in drivers/block/scsi_ioctl.c and ll_rw_block.c? Jens Axboe
2003-09-29 7:55 ` Jens Axboe
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=20030928160238.A18507@one-eyed-alien.net \
--to=mdharm-kernel@one-eyed-alien.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox