Skip to content

Commit

Permalink
cifs: fix regression with O_EXCL creates and optimize away lookup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and Steve French committed Jul 8, 2009
1 parent cc0bad7 commit 5ddf1e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5ddf1e0

Please sign in to comment.