aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2006-02-14 13:52:55 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-14 16:09:33 -0800
commit01fd9fda2ce462b44bafdac2fe6aacacf23531f2 (patch)
treec587c37f36d3800fae2fbfd0007f983b646a4c6c /drivers
parent61a34937982cace51853b5dc88f86380e31998c0 (diff)
[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: Peter Osterlund <petero2@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/pktcdvd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 73999762582..edf6bf29002 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1895,7 +1895,7 @@ static int pkt_open_write(struct pktcdvd_device *pd)
if ((ret = pkt_probe_settings(pd))) {
VPRINTK("pktcdvd: %s failed probe\n", pd->name);
- return -EIO;
+ return -EROFS;
}
if ((ret = pkt_set_write_settings(pd))) {
@@ -2053,10 +2053,9 @@ static int pkt_open(struct inode *inode, struct file *file)
goto out_dec;
}
} else {
- if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) {
- ret = -EIO;
+ ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE);
+ if (ret)
goto out_dec;
- }
/*
* needed here as well, since ext2 (among others) may change
* the blocksize at mount time