diff options
author | Peter Osterlund <petero2@telia.com> | 2006-02-20 21:28:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-20 23:00:11 -0500 |
commit | 9db91546570ca1b3bc90b4c2d25d5bb74a44be24 (patch) | |
tree | 9163ca7b347399d541ab4b543bf7097dc1e9f8ab | |
parent | ab863ec342cf148d02ed180b8ecf3a71a024e4be (diff) |
[PATCH] pktcdvd: Only return -EROFS when appropriate
When attempting to open the device for writing, only return -EROFS if the disc
appears to be readable but not writable.
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/block/pktcdvd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index eb83197cc36c..bc9b2bcd7dba 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1597,7 +1597,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | if (!pkt_writable_disc(pd, &di)) | 1599 | if (!pkt_writable_disc(pd, &di)) |
1600 | return -ENXIO; | 1600 | return -EROFS; |
1601 | 1601 | ||
1602 | pd->type = di.erasable ? PACKET_CDRW : PACKET_CDR; | 1602 | pd->type = di.erasable ? PACKET_CDRW : PACKET_CDR; |
1603 | 1603 | ||
@@ -1609,7 +1609,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1609 | 1609 | ||
1610 | if (!pkt_writable_track(pd, &ti)) { | 1610 | if (!pkt_writable_track(pd, &ti)) { |
1611 | printk("pktcdvd: can't write to this track\n"); | 1611 | printk("pktcdvd: can't write to this track\n"); |
1612 | return -ENXIO; | 1612 | return -EROFS; |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | /* | 1615 | /* |
@@ -1623,7 +1623,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1623 | } | 1623 | } |
1624 | if (pd->settings.size > PACKET_MAX_SECTORS) { | 1624 | if (pd->settings.size > PACKET_MAX_SECTORS) { |
1625 | printk("pktcdvd: packet size is too big\n"); | 1625 | printk("pktcdvd: packet size is too big\n"); |
1626 | return -ENXIO; | 1626 | return -EROFS; |
1627 | } | 1627 | } |
1628 | pd->settings.fp = ti.fp; | 1628 | pd->settings.fp = ti.fp; |
1629 | pd->offset = (be32_to_cpu(ti.track_start) << 2) & (pd->settings.size - 1); | 1629 | pd->offset = (be32_to_cpu(ti.track_start) << 2) & (pd->settings.size - 1); |
@@ -1665,7 +1665,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1665 | break; | 1665 | break; |
1666 | default: | 1666 | default: |
1667 | printk("pktcdvd: unknown data mode\n"); | 1667 | printk("pktcdvd: unknown data mode\n"); |
1668 | return 1; | 1668 | return -EROFS; |
1669 | } | 1669 | } |
1670 | return 0; | 1670 | return 0; |
1671 | } | 1671 | } |
@@ -1876,7 +1876,7 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
1876 | 1876 | ||
1877 | if ((ret = pkt_probe_settings(pd))) { | 1877 | if ((ret = pkt_probe_settings(pd))) { |
1878 | VPRINTK("pktcdvd: %s failed probe\n", pd->name); | 1878 | VPRINTK("pktcdvd: %s failed probe\n", pd->name); |
1879 | return -EROFS; | 1879 | return ret; |
1880 | } | 1880 | } |
1881 | 1881 | ||
1882 | if ((ret = pkt_set_write_settings(pd))) { | 1882 | if ((ret = pkt_set_write_settings(pd))) { |