Re: writable mmc profiles actually are writable

Jens Axboe
2003-10-06T20:29:04Z

On Mon, Oct 06 2003, Pat LaVarre wrote:
> > > +// if ((fp->f_mode & FMODE_WRITE) && !CDROM_CAN(CDC_DVD_RAM))
> > > +// return -EROFS;
> > > +// if (!cd->device->writeable)
> > > +// return 0;
> >
> > ... obviously wrong
>
> May I ask why this patch is obviously wrong?

Allowing write open of a read-only device.

> What actually breaks?

Lots of stuff. As I mentioned, only DVD-RAM "type" media will work with
sending random writes, things like cd-rw require special treatment.

> How do we benefit from having cdrom.ko and sr_mod.ko redundantly refuse
> writes?
>
> I figure I should try mount of a cd-rom with this patch. Maybe I get
> mount -w when I wanted mount -r and then life goes downhill from there.

> Or maybe iso fs doesn't try to write. Or ...

iso fs doesn't support writing.

--
Jens Axboe