diff options
author | Peter Osterlund <petero2@telia.com> | 2006-02-14 16:52:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-14 19:09:33 -0500 |
commit | 01fd9fda2ce462b44bafdac2fe6aacacf23531f2 (patch) | |
tree | c587c37f36d3800fae2fbfd0007f983b646a4c6c /drivers/block | |
parent | 61a34937982cace51853b5dc88f86380e31998c0 (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/block')
-rw-r--r-- | drivers/block/pktcdvd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 73999762582e..edf6bf29002e 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1895,7 +1895,7 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
1895 | 1895 | ||
1896 | if ((ret = pkt_probe_settings(pd))) { | 1896 | if ((ret = pkt_probe_settings(pd))) { |
1897 | VPRINTK("pktcdvd: %s failed probe\n", pd->name); | 1897 | VPRINTK("pktcdvd: %s failed probe\n", pd->name); |
1898 | return -EIO; | 1898 | return -EROFS; |
1899 | } | 1899 | } |
1900 | 1900 | ||
1901 | if ((ret = pkt_set_write_settings(pd))) { | 1901 | if ((ret = pkt_set_write_settings(pd))) { |
@@ -2053,10 +2053,9 @@ static int pkt_open(struct inode *inode, struct file *file) | |||
2053 | goto out_dec; | 2053 | goto out_dec; |
2054 | } | 2054 | } |
2055 | } else { | 2055 | } else { |
2056 | if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) { | 2056 | ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE); |
2057 | ret = -EIO; | 2057 | if (ret) |
2058 | goto out_dec; | 2058 | goto out_dec; |
2059 | } | ||
2060 | /* | 2059 | /* |
2061 | * needed here as well, since ext2 (among others) may change | 2060 | * needed here as well, since ext2 (among others) may change |
2062 | * the blocksize at mount time | 2061 | * the blocksize at mount time |