Commit bd2a8f79 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Broken CDROMs default to writeable

From: Jens Axboe <axboe@suse.de>

If the drive doesn't support GPCMD_READ_DISC_INFO at all, permit writeable
opens.
parent e6626b78
......@@ -725,7 +725,7 @@ static int cdrom_media_erasable(struct cdrom_device_info *cdi)
disc_information di;
if (cdrom_get_disc_info(cdi, &di))
return 0;
return -1;
return di.erasable;
}
......@@ -735,7 +735,16 @@ static int cdrom_media_erasable(struct cdrom_device_info *cdi)
*/
static int cdrom_dvdram_open_write(struct cdrom_device_info *cdi)
{
return !cdrom_media_erasable(cdi);
int ret = cdrom_media_erasable(cdi);
/*
* allow writable open if media info read worked and media is
* erasable, _or_ if it fails since not all drives support it
*/
if (!ret)
return 1;
return 0;
}
static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment