mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Larson <plars@austin.ibm.com>
To: Marcelo Tosati <marcelo@conectiva.com.br>,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.4.19-pre3 - readv/writev should return EINVAL for count=0
Date: 20 Mar 2002 12:53:47 -0600	[thread overview]
Message-ID: <1016650428.2202.98.camel@plars.austin.ibm.com> (raw)

This is a minor patch against 2.4.19-pre3 for readv/writev to have it
return EINVAL if count=0 is passed to it.  According to the man page and
also the specifications for readv/writev, this is the correct behaviour.

Thanks,
Paul Larson

Index: linux24/fs/read_write.c
diff -u linux24/fs/read_write.c:1.1.1.1 linux24/fs/read_write.c:1.1.1.1.2.1
--- linux24/fs/read_write.c:1.1.1.1	Wed Mar 20 12:00:25 2002
+++ linux24/fs/read_write.c	Wed Mar 20 12:19:06 2002
@@ -215,10 +215,9 @@
 	 * First get the "struct iovec" from user memory and
 	 * verify all the pointers
 	 */
-	ret = 0;
+	ret = -EINVAL;
 	if (!count)
 		goto out_nofree;
-	ret = -EINVAL;
 	if (count > UIO_MAXIOV)
 		goto out_nofree;
 	if (!file->f_op)




             reply	other threads:[~2002-03-20 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-20 18:53 Paul Larson [this message]
2002-03-20 23:48 ` Alan Cox
2002-03-21  7:34 ` Alex Riesen
2002-03-21 13:28   ` Paul Larson
2002-03-21 14:12     ` Alex Riesen

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=1016650428.2202.98.camel@plars.austin.ibm.com \
    --to=plars@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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

all inboxes | Powered by JetHome®