[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PATCH [2.4.0test10]: Kiobuf#05, -ENXIO beyond device EOF
Hi,
Final pending kiobuf fix for now: return ENXIO on requests for
non-zero data reads/writes beyond the end of a block device,
consistent with SU's
[ENXIO]
A request was made of a non-existent device, or the
request was outside the capabilities of the device.
I've had this requested from other vendors who expect this behaviour
on raw devices, so it seems to be the accepted behaviour.
Return success on zero-byte requests --- SU and POSIX are picky about
that.
--Stephen
diff -ru linux-2.4.0-test10.kio.04/drivers/char/raw.c linux-2.4.0-test10.kio.05/drivers/char/raw.c
--- linux-2.4.0-test10.kio.04/drivers/char/raw.c Thu Nov 2 12:08:54 2000
+++ linux-2.4.0-test10.kio.05/drivers/char/raw.c Thu Nov 2 14:19:32 2000
@@ -277,8 +277,12 @@
if ((*offp & sector_mask) || (size & sector_mask))
return -EINVAL;
- if ((*offp >> sector_bits) > limit)
+ if ((*offp >> sector_bits) >= limit) {
+ if (size) {
+ return -ENXIO;
+ }
return 0;
+ }
/*
* We'll just use one kiobuf