Re: 2.6.0-mm2

From: Jens Axboe
Date: Tue Dec 30 2003 - 04:47:38 EST


On Mon, Dec 29 2003, Diego Calleja wrote:
> El Mon, 29 Dec 2003 21:57:26 +0100 Felipe Alfaro Solana <felipe_alfaro@xxxxxxxxxxxxx> escribió:
>
> > The same happens here. cdrecord is broken under -mm, but works fine with
> > plain 2.6.0.
>
>
>
> I'm seeing the same here:
>
> open("/dev/cd-rw", O_RDWR|O_NONBLOCK) = -1 EROFS (Read-only file system)
> write(2, "cdrecord.mmap: Read-only file sy"..., 89cdrecord.mmap: Read-only file system. Cannot open '/dev/cd-rw'. Cannot open SCSI driver.) = 89

--- drivers/cdrom/cdrom.c~ 2003-12-29 15:58:55.698005022 +0100
+++ drivers/cdrom/cdrom.c 2003-12-29 16:01:32.555918156 +0100
@@ -740,20 +740,21 @@

cdinfo(CD_OPEN, "entering cdrom_open\n");
cdi->use_count++;
- ret = -EROFS;
- if (fp->f_mode & FMODE_WRITE) {
- if (!CDROM_CAN(CDC_RAM))
- goto out;
- if (cdrom_open_write(cdi))
- goto out;
- }

/* if this was a O_NONBLOCK open and we should honor the flags,
* do a quick open without drive/disc integrity checks. */
if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS))
ret = cdi->ops->open(cdi, 1);
- else
+ else {
+ if (fp->f_mode & FMODE_WRITE) {
+ ret = -EROFS;
+ if (!CDROM_CAN(CDC_RAM))
+ goto out;
+ if (cdrom_open_write(cdi))
+ goto out;
+ }
ret = open_for_data(cdi);
+ }

cdinfo(CD_OPEN, "Use count for \"/dev/%s\" now %d\n", cdi->name, cdi->use_count);
/* Do this on open. Don't wait for mount, because they might

Fix is with andrew for -mm3

--
Jens Axboe

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