linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Viro <viro@math.psu.edu>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Re: test12-pre6
Date: Wed, 6 Dec 2000 03:06:36 -0500 (EST)	[thread overview]
Message-ID: <Pine.GSO.4.21.0012060303540.14974-100000@weyl.math.psu.edu> (raw)
In-Reply-To: <Pine.LNX.4.10.10012052318270.5786-100000@penguin.transmeta.com>

	truncate() and ftruncate() return values are different from the
POSIX requirements and from the values returned by other Unices (and from
our own manpages, BTW). Trivial fix follows. Rationale: see truncate(2),
ftruncate(2), POSIX or try to call the thing on other Unices.

	Please, apply.

diff -urN rc12-pre5/fs/open.c rc12-pre5-truncate/fs/open.c
--- rc12-pre5/fs/open.c	Wed Nov 29 21:37:31 2000
+++ rc12-pre5-truncate/fs/open.c	Tue Dec  5 14:53:59 2000
@@ -102,7 +102,12 @@
 		goto out;
 	inode = nd.dentry->d_inode;
 
-	error = -EACCES;
+	/* For directories it's -EISDIR, for other non-regulars - -EINVAL */
+	error = -EISDIR;
+	if (S_ISDIR(inode->i_mode))
+		goto dput_and_out;
+
+	error = -EINVAL;
 	if (!S_ISREG(inode->i_mode))
 		goto dput_and_out;
 
@@ -163,7 +168,7 @@
 		goto out;
 	dentry = file->f_dentry;
 	inode = dentry->d_inode;
-	error = -EACCES;
+	error = -EINVAL;
 	if (!S_ISREG(inode->i_mode) || !(file->f_mode & FMODE_WRITE))
 		goto out_putf;
 	error = -EPERM;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2000-12-06  8:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-06  7:25 test12-pre6 Linus Torvalds
2000-12-06  7:50 ` test12-pre6 Alexander Viro
2000-12-06  7:54 ` [PATCH] test12-pre6 Alexander Viro
2000-12-06  8:03 ` Alexander Viro
2000-12-06  8:06 ` Alexander Viro [this message]
2000-12-06  8:26   ` Tigran Aivazian
2000-12-06  8:38     ` Tigran Aivazian
2000-12-06  8:56       ` Tigran Aivazian
2000-12-06  9:07         ` Alexander Viro
2000-12-06  9:29           ` Tigran Aivazian
2000-12-06  8:11 ` Alexander Viro
2000-12-06 11:47 ` test12-pre6 Wakko Warner
2000-12-06 12:04   ` test12-pre6 Andrew Morton
2000-12-07  1:43     ` test12-pre6 Wakko Warner
2000-12-06 13:06 ` test12-pre6 Tobias Ringstrom
2000-12-06 13:29   ` test12-pre6 Miles Lane
2000-12-06 18:08 ` test12-pre6 Erik Mouw
2000-12-06 18:38   ` test12-pre6 Linus Torvalds
2000-12-06 19:08     ` test12-pre6 Erik Mouw
2000-12-06 19:38       ` test12-pre6 Linus Torvalds
2000-12-06 20:09         ` test12-pre6 Erik Mouw
2000-12-06 21:06           ` test12-pre6 Jeff Garzik
2000-12-06 22:57             ` test12-pre6 Miles Lane
2000-12-06 23:10               ` test12-pre6 Johannes Erdfelt
2000-12-06 23:13               ` test12-pre6 Jeff Garzik
2000-12-06 23:17                 ` test12-pre6 Miles Lane
2000-12-07  0:05           ` test12-pre6 Miles Lane

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=Pine.GSO.4.21.0012060303540.14974-100000@weyl.math.psu.edu \
    --to=viro@math.psu.edu \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).