summaryrefslogtreecommitdiffstats
path: root/drivers/block/pktcdvd.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2006-02-21 03:28:04 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-21 05:00:11 +0100
commit9db91546570ca1b3bc90b4c2d25d5bb74a44be24 (patch)
tree9163ca7b347399d541ab4b543bf7097dc1e9f8ab /drivers/block/pktcdvd.c
parent[PATCH] pktcdvd: Fix the logic in the pkt_writable_track function (diff)
downloadlinux-9db91546570ca1b3bc90b4c2d25d5bb74a44be24.tar.xz
linux-9db91546570ca1b3bc90b4c2d25d5bb74a44be24.zip
[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>
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c10
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)
}
if (!pkt_writable_disc(pd, &di))
- return -ENXIO;
+ return -EROFS;
pd->type = di.erasable ? PACKET_CDRW : PACKET_CDR;
@@ -1609,7 +1609,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
if (!pkt_writable_track(pd, &ti)) {
printk("pktcdvd: can't write to this track\n");
- return -ENXIO;
+ return -EROFS;
}
/*
@@ -1623,7 +1623,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
}
if (pd->settings.size > PACKET_MAX_SECTORS) {
printk("pktcdvd: packet size is too big\n");
- return -ENXIO;
+ return -EROFS;
}
pd->settings.fp = ti.fp;
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)
break;
default:
printk("pktcdvd: unknown data mode\n");
- return 1;
+ return -EROFS;
}
return 0;
}
@@ -1876,7 +1876,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 -EROFS;
+ return ret;
}
if ((ret = pkt_set_write_settings(pd))) {