Commit 01fd9fda authored by Peter Osterlund's avatar Peter Osterlund Committed by Linus Torvalds

[PATCH] pktcdvd: Allow non-writable media to be mounted

If opening for write fails, the open method should return -EROFS.  This makes
"mount" try again with a read-only mount, instead of just giving up.
Signed-off-by: default avatarPeter Osterlund <petero2@telia.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 61a34937
...@@ -1895,7 +1895,7 @@ static int pkt_open_write(struct pktcdvd_device *pd) ...@@ -1895,7 +1895,7 @@ static int pkt_open_write(struct pktcdvd_device *pd)
if ((ret = pkt_probe_settings(pd))) { if ((ret = pkt_probe_settings(pd))) {
VPRINTK("pktcdvd: %s failed probe\n", pd->name); VPRINTK("pktcdvd: %s failed probe\n", pd->name);
return -EIO; return -EROFS;
} }
if ((ret = pkt_set_write_settings(pd))) { if ((ret = pkt_set_write_settings(pd))) {
...@@ -2053,10 +2053,9 @@ static int pkt_open(struct inode *inode, struct file *file) ...@@ -2053,10 +2053,9 @@ static int pkt_open(struct inode *inode, struct file *file)
goto out_dec; goto out_dec;
} }
} else { } else {
if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) { ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE);
ret = -EIO; if (ret)
goto out_dec; goto out_dec;
}
/* /*
* needed here as well, since ext2 (among others) may change * needed here as well, since ext2 (among others) may change
* the blocksize at mount time * the blocksize at mount time
......
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