diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-03-24 16:08:59 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-03-24 16:08:59 -0800 |
| commit | bd2a8f7991f5cc9d7f6bffcbfc28a85e16abe04e (patch) | |
| tree | 248883782c1ec5690b01aa0b1a59f503fc7365c2 /drivers | |
| parent | e6626b783ef276962e9d6294ba54c13fcf5d2a54 (diff) | |
[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.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/cdrom/cdrom.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 7b3fbd6901cd..9784f1945073 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -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) |
