lkml.org 
[lkml]   [2006]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 5/5] pktcdvd: Only return -EROFS when appropriate
From
Date
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>
---
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 dec68d0..772b63c 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1598,7 +1598,7 @@ static int pkt_probe_settings(struct pkt
}

if (!pkt_writable_disc(pd, &di))
- return -ENXIO;
+ return -EROFS;

pd->type = di.erasable ? PACKET_CDRW : PACKET_CDR;

@@ -1610,7 +1610,7 @@ static int pkt_probe_settings(struct pkt

if (!pkt_writable_track(pd, &ti)) {
printk("pktcdvd: can't write to this track\n");
- return -ENXIO;
+ return -EROFS;
}

/*
@@ -1624,7 +1624,7 @@ static int pkt_probe_settings(struct pkt
}
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);
@@ -1666,7 +1666,7 @@ static int pkt_probe_settings(struct pkt
break;
default:
printk("pktcdvd: unknown data mode\n");
- return 1;
+ return -EROFS;
}
return 0;
}
@@ -1877,7 +1877,7 @@ static int pkt_open_write(struct pktcdvd

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))) {
--
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-19 17:02    [from the cache]
©2003-2011 Jasper Spaans