From 22ba8165824720831ff5ee099112f274d2dc8b02 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 30 Jul 2012 11:50:30 +0400 Subject: [PATCH] --- yaml --- r: 320968 b: refs/heads/master c: f8310c59201b183ebee2e3fe0c7242f5729be0af h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index ae9590b5a668..219ab80844ed 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bf8848918d751c1fb86f6514a75bf8d406f1c3c3 +refs/heads/master: f8310c59201b183ebee2e3fe0c7242f5729be0af diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 618d3531cf9f..e133bf3bbb03 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2418,7 +2418,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry, if ((open_flag & O_CREAT) && !IS_POSIXACL(dir)) mode &= ~current_umask(); - if (open_flag & O_EXCL) { + if ((open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT)) { open_flag &= ~O_TRUNC; *opened |= FILE_CREATED; } @@ -2742,7 +2742,7 @@ static int do_last(struct nameidata *nd, struct path *path, } error = -EEXIST; - if (open_flag & O_EXCL) + if ((open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT)) goto exit_dput; error = follow_managed(path, nd->flags);