* Re: PATCH [2.4.0test10]: Kiobuf#05, -ENXIO beyond device EOF
@ 2000-11-02 16:07 Stephen C. Tweedie
0 siblings, 0 replies; only message in thread
From: Stephen C. Tweedie @ 2000-11-02 16:07 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Rik van Riel, Ingo Molnar, Stephen Tweedie, linux-mm
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
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
[-- Attachment #2: 05-enxio.diff --]
[-- Type: text/plain, Size: 517 bytes --]
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-11-02 16:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-02 16:07 PATCH [2.4.0test10]: Kiobuf#05, -ENXIO beyond device EOF Stephen C. Tweedie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox