Re: [2.6.8-rc4-bk] NFS oops on x86-64

From: Trond Myklebust
Date: Fri Aug 13 2004 - 21:22:07 EST


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();

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