From patchwork Wed Jul 8 21:58:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 29609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by bilbo.ozlabs.org (Postfix) with ESMTP id D3DDFB6F20 for ; Thu, 9 Jul 2009 07:59:01 +1000 (EST) Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id E1BAE163D00 for ; Wed, 8 Jul 2009 21:58:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.8 tests=AWL,BAYES_00, DNS_FROM_RFC_POST,SPF_PASS autolearn=no version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-yx0-f198.google.com (mail-yx0-f198.google.com [209.85.210.198]) by lists.samba.org (Postfix) with ESMTP id A8DC3163BC2 for ; Wed, 8 Jul 2009 21:57:49 +0000 (GMT) Received: by yxe36 with SMTP id 36so4377650yxe.10 for ; Wed, 08 Jul 2009 14:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=z+IbL5GYqEE33lsqSqpMJ3BB6HXDrTwA7x8VSeqcEFY=; b=XulhgbM6oX0vvlgmTtcVDqcZpGoz3uvTYqUM3hiwyTL8tz4ssltPOjQ1RvrNzuaS47 U/Y2+ItUiuiM8eDuPXGTRj1VgkaKhMXzC8F5cfSYfSUSEbPWjOIir9PC1RWLFnBjlWb8 3QVZqpJ48mjaMPTGZBrB1sjT1Y7o6/RPyDdvM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=dPMpd2YdAULLnFc89e8c4qQ9IrmsURudeecCcWbJSEg0HSq5fNQnaxhdsGExKJx1xb bfYmXQJ4tIUkq2rSjRTbtcIdK+snp1YJG8GrrHl3yCINAsCSDOVZPc10h0uy0MKMR4MA 6hZ8rZNTh2nScScuvuC/BI3ytGTdlfn3lRlDk= MIME-Version: 1.0 Received: by 10.150.97.4 with SMTP id u4mr2828046ybb.171.1247090307055; Wed, 08 Jul 2009 14:58:27 -0700 (PDT) Date: Wed, 8 Jul 2009 16:58:27 -0500 Message-ID: <524f69650907081458y6b6301e0mc2340f0f8a36b8bc@mail.gmail.com> From: Steve French To: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] lookup create with O_EXCL patch merged X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+incoming=patchwork.ozlabs.org@lists.samba.org Errors-To: linux-cifs-client-bounces+incoming=patchwork.ozlabs.org@lists.samba.org 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)