Skip to content

Commit

Permalink
[PATCH] pktcdvd: Allow non-writable media to be mounted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Osterlund authored and Linus Torvalds committed Feb 15, 2006
1 parent 61a3493 commit 01fd9fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01fd9fd

Please sign in to comment.