From: Jens Axboe <axboe@suse.de>
To: Thomas Voegtle <thomas@voegtle-clan.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: no atapi cdrecord burning with 2.6.0-test11-bk10 / bk13
Date: Wed, 17 Dec 2003 17:48:32 +0100 [thread overview]
Message-ID: <20031217164832.GA2495@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.21.0312171604390.32339-100000@needs-no.brain.uni-freiburg.de>
On Wed, Dec 17 2003, Thomas Voegtle wrote:
>
> Hello,
>
> cdrecord -dev=ATAPI -scanbus with 2.6.0-test11-bk10 and bk13 shows this:
>
> scsibus0:
> 0,0,0 0) '' '' '' NON CCS Disk
> 0,1,0 1) '' '' '' NON CCS Disk
>
>
> but this works well with 2.6.0-test11.
> =>
>
> 0,0,0 0) 'CREATIVE' ' CD5233E ' '2.05' Removable CD-ROM
> 0,1,0 1) 'PLEXTOR ' 'CD-R PX-W1610A' '1.04' Removable CD-ROM
>
> SuSE 9.0
Apply this to test11-bkLATEST
===== drivers/block/scsi_ioctl.c 1.38 vs edited =====
--- 1.38/drivers/block/scsi_ioctl.c Thu Dec 11 18:55:17 2003
+++ edited/drivers/block/scsi_ioctl.c Wed Dec 17 13:49:40 2003
@@ -150,13 +150,10 @@
struct request *rq;
struct bio *bio;
char sense[SCSI_SENSE_BUFFERSIZE];
- unsigned char cdb[BLK_MAX_CDB];
void *buffer;
if (hdr->interface_id != 'S')
return -EINVAL;
- if (hdr->cmd_len > sizeof(rq->cmd))
- return -EINVAL;
/*
* we'll do that later
@@ -167,9 +164,6 @@
if (hdr->dxfer_len > (q->max_sectors << 9))
return -EIO;
- if (copy_from_user(cdb, hdr->cmdp, hdr->cmd_len))
- return -EFAULT;
-
reading = writing = 0;
buffer = NULL;
bio = NULL;
@@ -220,7 +214,7 @@
* fill in request structure
*/
rq->cmd_len = hdr->cmd_len;
- memcpy(rq->cmd, cdb, hdr->cmd_len);
+ memcpy(rq->cmd, hdr->cmdp, hdr->cmd_len);
if (sizeof(rq->cmd) != hdr->cmd_len)
memset(rq->cmd + hdr->cmd_len, 0, sizeof(rq->cmd) - hdr->cmd_len);
@@ -436,12 +430,23 @@
break;
case SG_IO: {
struct sg_io_hdr hdr;
+ unsigned char cdb[BLK_MAX_CDB], *old_cdb;
- if (copy_from_user(&hdr, (struct sg_io_hdr *) arg, sizeof(hdr))) {
- err = -EFAULT;
+ err = -EFAULT;
+ if (copy_from_user(&hdr, (struct sg_io_hdr *) arg, sizeof(hdr)))
break;
- }
+ err = -EINVAL;
+ if (hdr.cmd_len > sizeof(rq->cmd))
+ break;
+ err = -EFAULT;
+ if (copy_from_user(cdb, hdr.cmdp, hdr.cmd_len))
+ break;
+
+ old_cdb = hdr.cmdp;
+ hdr.cmdp = cdb;
err = sg_io(q, bdev, &hdr);
+
+ hdr.cmdp = old_cdb;
if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr)))
err = -EFAULT;
break;
--
Jens Axboe
next prev parent reply other threads:[~2003-12-17 16:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-17 15:09 no atapi cdrecord burning with 2.6.0-test11-bk10 / bk13 Thomas Voegtle
2003-12-17 15:20 ` Måns Rullgård
2003-12-17 16:08 ` Thomas Voegtle
2003-12-17 17:23 ` Martin Schlemmer
2003-12-17 16:19 ` Gene Heskett
2003-12-17 16:25 ` Thomas Voegtle
2003-12-17 16:41 ` Gene Heskett
2003-12-17 16:49 ` Jens Axboe
2003-12-17 17:27 ` Gene Heskett
2003-12-17 18:33 ` Jens Axboe
2003-12-17 21:47 ` bill davidsen
2003-12-17 16:30 ` bill davidsen
2003-12-17 16:48 ` Jens Axboe [this message]
2003-12-17 17:35 ` Thomas Voegtle
2003-12-17 18:11 ` Martin Schlemmer
2003-12-17 18:32 ` 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=20031217164832.GA2495@suse.de \
--to=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas@voegtle-clan.de \
/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.