linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rik van Riel <riel@nl.linux.org>, Ingo Molnar <mingo@redhat.com>,
	Stephen Tweedie <sct@redhat.com>,
	linux-mm@kvack.org
Subject: Re: PATCH [2.4.0test10]: Kiobuf#05, -ENXIO beyond device EOF
Date: Thu, 2 Nov 2000 16:07:08 +0000	[thread overview]
Message-ID: <20001102160708.H1876@redhat.com> (raw)

[-- 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

                 reply	other threads:[~2000-11-02 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001102160708.H1876@redhat.com \
    --to=sct@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=riel@nl.linux.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox