lkml.org 
[lkml]   [2010]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.6.35.2: NFS related Oops

On Tue Aug 17, 2010 at 18:09:53 +0800, Bian Naimeng wrote:
> Please try to apply the followed patch.

Thanks, this fixes the Oops. Patch is required for both 2.6.35 and
2.6.36 trees.


----
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


Adam
--
Adam adam@os.inf.tu-dresden.de
Lackorzynski http://os.inf.tu-dresden.de/~adam/


\
 
 \ /
  Last update: 2010-08-17 19:17    [from the cache]
©2003-2011 Jasper Spaans