All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>,
	schilling@fokus.fraunhofer.de, linux-scsi@vger.kernel.org,
	dgilbert@interlog.com
Subject: Re: [Bug 7026] CD/DVD burning with USB writer doesn't work
Date: Wed, 06 Dec 2006 13:43:22 -0500	[thread overview]
Message-ID: <45770F4A.3010305@torque.net> (raw)
In-Reply-To: <1165423635.2810.33.camel@mulgrave.il.steeleye.com>

James Bottomley wrote:
> On Wed, 2006-12-06 at 11:32 -0500, Alan Stern wrote:
>>> But how did he get the file descriptor?  He opened a device name, which
>>> could have been used to get the sysfs file.
>> The device name was probably something like /dev/sg0.  This doesn't easily
>> permit one to find the corresponding sysfs filename for the real
>> underlying device, although it can be done with difficulty.  (That's why I
>> used the excessively-ornate sysfs pathname in the Bugzilla entry.)  It
>> certainly wouldn't be as easy as using an ioctl.
>>
>> It wouldn't be as uniform either.  The search through sysfs would have to 
>> be different depending on whether the device name was /dev/sr0 or 
>> /dev/sg0.
> 
> Realistically, no-one makes SCSI CDs or DVDs any more ... I know, I've
> tried to get some for some of my older boxes.  Most of them nowadays are
> IDE attachments, which don't have a /dev/sg node.  So /dev/sg is really
> the legacy mode for burning.  The correct way to do it today is to use
> the actual device name ... then you don't have to worry about what the
> transport is any more.

All CD and DVD drive these days use SCSI. That is
SCSI command sets: MMC and SPC. Very few use the
SCSI Parallel Interface (SPI). An increasing number
will be using S-ATAPI and they could be seen by
the OS via "SCSI" transports: FC and SAS (+ SATA).

>>>> Is the patch below acceptable?
>>> Really, no.  The parameter you're fishing for is a block parameter, not
>>> a SCSI parameter ... it should really be a block ioctl if we have to
>>> have an ioctl at all.
>> I could easily enough rewrite the patch to put the ioctl somewhere else
>> (although I'm not quite sure exactly where would be best).  But do
>> non-block devices have request queues?  What about the points that Doug
>> raised:
> 
> All CD/DVD burners are block devices, which is the problem set under
> discussion.

CD/DVD burners are block device for read operations
only. When they are "burning" they are not block
devices in the normal sense.

So if this was classic Unix a block device node would
be used for reading and a raw device node for writing.
Just like .... I'm wasting keystrokes.

>> On Tue, 5 Dec 2006, Douglas Gilbert wrote:
>>
>>> Apart from sensibly yielding the max size in bytes, your patch
>>> has the added benefit of allowing non-block devices (e.g. tape,
>>> processor and enclosure services) to find out what limit the
>>> OS/host has placed on each command's maximum transfer size.
> 
> They all possess block queues, yes, so we should really allow access to
> the block ioctls for them.
> 
>>> If you manage to get that ioctl in, then ungrateful people
>>> will ask for the corresponding "set" operation as well.
>>>
>>>
>>> To illustrate the /sys mess look at naming of the sysfs approach
>>> to this problem. For example:
>>>   /sys/block/sde/queue/max_sectors_kb
>>>     - it is not only a "block" property
>>>     - sde is an "end device" and suggests information from that
>>>       device's Block Limits VPD page, actually it is a limit
>>>       imposed by the OS and the host used to access that device
>>>     - what has "queue" got to do with it?
>>>     - "max_sectors_kb" should have units of bytes
>> In addition to all of these points, there remains the peculiar location of 
>> the SG_ ioctls.  They are implemented it two places in the kernel: 
>> block/scsi_ioctl.c and drivers/scsi/sg.c.  And the two implementations of 
>> e.g. SG_SET_RESERVED_SIZE don't even do the same thing!
> 
> I have no idea why the block layer even implements
> SG_SET_RESERVED_SIZE ... I suspect it was some legacy application
> compatibility problem, so it probably can be eliminated.

It was put there to trick cdrecord!

Doug Gilbert

  parent reply	other threads:[~2006-12-06 18:43 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 20:11 [Bug 7026] CD/DVD burning with USB writer doesn't work Alan Stern
2006-12-04 21:07 ` James Bottomley
2006-12-05 20:52   ` Alan Stern
2006-12-05 21:50     ` James Bottomley
2006-12-05 22:46       ` Joerg Schilling
2006-12-05 22:58         ` James Bottomley
2006-12-05 23:14           ` Joerg Schilling
2006-12-06 16:12             ` James Bottomley
2006-12-06 16:57               ` Douglas Gilbert
2006-12-06 21:34                 ` Mike Christie
2006-12-06 21:46                   ` Alan Stern
2006-12-07 10:34                     ` Joerg Schilling
2006-12-07 18:27                       ` Alan Stern
2006-12-08 12:45                         ` Joerg Schilling
2006-12-08 15:46                           ` Alan Stern
2006-12-06 22:50                   ` Mike Christie
2006-12-06 23:42                     ` Jeremy Linton
2006-12-06 23:55                       ` Jeremy Linton
2006-12-07  1:22                         ` Mike Christie
2006-12-07  1:40                           ` Mike Christie
2006-12-07  2:05                           ` Mike Christie
2006-12-06 17:42               ` Joerg Schilling
2006-12-06 16:32             ` Alan Stern
2006-12-06 16:47               ` James Bottomley
2006-12-06 17:21                 ` Alan Stern
2006-12-06 17:25                   ` James Bottomley
2006-12-06 18:58                     ` Alan Stern
2006-12-06 19:13                       ` James Bottomley
2006-12-06 20:31                         ` Alan Stern
2007-01-08 16:19                         ` Alan Stern
2007-01-08 16:25                           ` James Bottomley
2007-01-24 20:36                             ` Alan Stern
2007-01-08 19:24                           ` Jens Axboe
2006-12-06 17:51                   ` Joerg Schilling
2006-12-06 17:49                 ` Joerg Schilling
2006-12-06 17:59                   ` James Bottomley
2006-12-06 18:38                     ` Douglas Gilbert
2006-12-06 18:50                       ` James Bottomley
2006-12-06 20:04                         ` Douglas Gilbert
2006-12-06 18:48                     ` Joerg Schilling
2006-12-06 18:43                 ` Douglas Gilbert [this message]
2006-12-05 21:55     ` Douglas Gilbert
2006-12-05 23:08       ` Joerg Schilling
2006-12-05 22:35     ` Joerg Schilling
2006-12-05 23:03     ` Joerg Schilling
  -- strict thread matches above, loose matches on Subject: below --
2007-02-09 10:50 Joerg Schilling
2007-02-09 17:57 ` Alan Stern
2007-02-10  2:02   ` James Bottomley

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=45770F4A.3010305@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@SteelEye.com \
    --cc=Joerg.Schilling@fokus.fraunhofer.de \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=schilling@fokus.fraunhofer.de \
    --cc=stern@rowland.harvard.edu \
    /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.