mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [2.6.8-rc4-bk] NFS oops on x86-64
Date: Fri, 13 Aug 2004 22:21:16 -0400	[thread overview]
Message-ID: <1092450076.4078.34.camel@lade.trondhjem.org> (raw)
In-Reply-To: <1092447909.4078.18.camel@lade.trondhjem.org>

På fr , 13/08/2004 klokka 21:45, skreiv Trond Myklebust:

> I can see 2 problems in the NFS code alone:
> 
>   1) Replacing a test for whether or not O_APPEND and O_DIRECT are
> *both* set with one that checks whether either is set.
>   2) Adding a wonderful check in nfs_open() that causes it to return
> immediately if this new nfs_check_flags() returns 0 (i.e. OK).

The following patch should fix up those two issues, but frankly, I'm not
convinced that it is much of an improvement to be replacing the old
fcntl() interface with something that doesn't even pass down the struct
file for which the user is trying to change the open mode.

Trond

--- linux-2.6.8-rc4/fs/nfs/file.c.orig	2004-08-13 14:21:25.000000000 -0400
+++ linux-2.6.8-rc4/fs/nfs/file.c	2004-08-13 21:50:28.000000000 -0400
@@ -72,7 +72,7 @@ struct inode_operations nfs_file_inode_o
 
 static int nfs_check_flags(int flags)
 {
-	if (flags & (O_APPEND | O_DIRECT))
+	if (flags & (O_APPEND | O_DIRECT) == (O_APPEND | O_DIRECT))
 		return -EINVAL;
 
 	return 0;
@@ -89,7 +89,7 @@ nfs_file_open(struct inode *inode, struc
 	int res;
 
 	res = nfs_check_flags(filp->f_flags);
-	if (!res)
+	if (res != 0)
 		return res;
 
 	lock_kernel();


  reply	other threads:[~2004-08-14  2:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-14  1:07 Jeff Garzik
2004-08-14  1:45 ` Trond Myklebust
2004-08-14  2:21   ` Trond Myklebust [this message]
2004-08-14  2:24     ` Trond Myklebust
2004-08-14  2:42       ` Jeff Garzik
2004-08-14  3:23       ` [PATCH] " Jeff Garzik
2004-08-14  2:22   ` Jeff Garzik

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=1092450076.4078.34.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®