diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-07-05 11:01:02 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-07-08 21:55:45 +0000 |
commit | 5ddf1e0ff00fd808c048d0b920784828276cc516 (patch) | |
tree | 3510f7e7274700478444ad277f7025519417c7ea /fs/cifs | |
parent | cc0bad7552308e8905d6ea56e6b7811fa67e716d (diff) | |
download | kernel_samsung_crespo-5ddf1e0ff00fd808c048d0b920784828276cc516.zip kernel_samsung_crespo-5ddf1e0ff00fd808c048d0b920784828276cc516.tar.gz kernel_samsung_crespo-5ddf1e0ff00fd808c048d0b920784828276cc516.tar.bz2 |
cifs: fix regression with O_EXCL creates and optimize away lookup
cifs: fix regression with O_EXCL creates and optimize away lookup
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Shirish Pargaonkar <shirishp@gmail.com>
CC: Stable Kernel <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/dir.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index a40054f..ff55fc6 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -643,6 +643,15 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, } } + /* + * O_EXCL: optimize away the lookup, but don't hash the dentry. Let + * the VFS handle the create. + */ + if (nd->flags & LOOKUP_EXCL) { + d_instantiate(direntry, NULL); + return 0; + } + /* can not grab the rename sem here since it would deadlock in the cases (beginning of sys_rename itself) in which we already have the sb rename sem */ |