Re: 2.6.35.2: NFS related Oops

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bian Naimeng
Date: Tuesday, August 17, 2010 - 3:09 am

> Hi,

  Please try to apply the followed patch.

  ----

   We we open a positive file just with O_EXCL but no O_CREAT, may cause kernel crash.

  Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 fs/nfs/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 29539ce..1a672dd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1100,7 +1100,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
 		goto no_open_dput;
 	openflags = nd->intent.open.flags;
 	/* We cannot do exclusive creation on a positive dentry */
-	if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
+	if (openflags & O_EXCL)
 		goto no_open_dput;
 	/* We can't create new files, or truncate existing ones here */
 	openflags &= ‾(O_CREAT|O_TRUNC);
-- 
1.7.0




-- 
Regards
Bian Naimeng

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.35.2: NFS related Oops, Adam Lackorzynski, (Mon Aug 16, 2:50 pm)
Re: 2.6.35.2: NFS related Oops, Bian Naimeng, (Tue Aug 17, 3:09 am)
Re: 2.6.35.2: NFS related Oops, Adam Lackorzynski, (Tue Aug 17, 10:14 am)
Re: 2.6.35.2: NFS related Oops, Trond Myklebust, (Tue Aug 17, 3:43 pm)
Re: 2.6.35.2: NFS related Oops, Bian Naimeng, (Tue Aug 17, 7:12 pm)
Re: 2.6.35.2: NFS related Oops, Bian Naimeng, (Tue Aug 17, 7:49 pm)
Re: 2.6.35.2: NFS related Oops, Adam Lackorzynski, (Wed Aug 18, 4:36 am)
Re: 2.6.35.2: NFS related Oops, Trond Myklebust, (Wed Aug 18, 6:36 am)
Re: 2.6.35.2: NFS related Oops, Adam Lackorzynski, (Wed Aug 18, 8:44 am)