lkml.org 
[lkml]   [2004]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: K3b and 2.6.9?


On Tue, 31 Aug 2004, Tim Fairchild wrote:
>
> Thanks. Yes I realize that and understand why this is a good idea to
> have. But most of the verify_command list seems fine and I find the
> following works, but don't know if this is any 'safer' or not... This is
> the particular test that makes the difference to k3b/cdrecord, but I
> don't know enough to work out what it actually does... (this is with
> 2.6.9-rc1-bk6)
>
> --- a/drivers/block/scsi_ioctl.c.original 2004-08-30 23:50:16.000000000 +1000
> +++ b/drivers/block/scsi_ioctl.c 2004-08-31 08:37:56.000000000 +1000
> @@ -192,7 +192,7 @@
>
> /* Write-safe commands just require a writable open.. */
> if (type & CMD_WRITE_SAFE) {
> - if (file->f_mode & FMODE_WRITE)
> +/* if (file->f_mode & FMODE_WRITE) */
> return 0;
> }

Ehh.. This seems to imply that K3b opens the device for _reading_ when it
wants to burn a CD-ROM. It also implies that K3b only uses the commands
that are already marked as being "safe for writing", so the kernel command
list is apparently fine.

Which implies that the only way to fix it sanely is literally to have K3b
open the device for writing, and then everything will be happy.

As far as I can tell, the fix should be a simple one-liner: make sure that
K3b opens the device with O_RDWR | O_NONBLOCK instead of using O_RDONLY |
O_NONBLOCK. The fix looks trivial, it's in

src/device/k3bdevice.cpp:
int K3bCdDevice::openDevice( const char* name );

(two places).

That "kind of" makes sense anyway - if you want to write to the disk, you
damn well should open the disk for writing, no? So clearly K3b right now
is doing something pretty nonsensical.

Can somebody who is active in the K3b community check with the K3b
authors, and please try to get that fixed?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.072 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site