From patchwork Wed Jul 8 21:58:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: lookup create with O_EXCL patch merged X-Patchwork-Submitter: Steve French X-Patchwork-Id: 29609 Message-Id: <524f69650907081458y6b6301e0mc2340f0f8a36b8bc@mail.gmail.com> To: linux-cifs-client@lists.samba.org Date: Wed, 8 Jul 2009 16:58:27 -0500 From: Steve French List-Id: The Linux CIFS VFS client Now that it has been tested by Shirish, merged Jeff's patch into cifs-2.6.git cifs: fix regression with O_EXCL creates and optimize away lookup Signed-off-by: Jeff Layton Tested-by: Shirish Pargaonkar CC: Stable Kernel --- in which we already have the sb rename sem */ 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)