From patchwork Thu Feb 11 19:58:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 45152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 9659FB7D25 for ; Fri, 12 Feb 2010 06:59:26 +1100 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 3BF57AD23C; Thu, 11 Feb 2010 13:10:35 -0700 (MST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.8 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.samba.org (Postfix) with ESMTP id 36B9BAD235 for ; Thu, 11 Feb 2010 13:10:15 -0700 (MST) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1BJwwf4026849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2010 14:58:59 -0500 Received: from localhost.localdomain (barsoom.rdu.redhat.com [10.11.228.36]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1BJwoUN001909; Thu, 11 Feb 2010 14:58:57 -0500 From: Jeff Layton To: smfrench@gmail.com Date: Thu, 11 Feb 2010 14:58:50 -0500 Message-Id: <1265918330-2810-9-git-send-email-jlayton@redhat.com> In-Reply-To: <1265918330-2810-1-git-send-email-jlayton@redhat.com> References: <1265918330-2810-1-git-send-email-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Cc: petr@vandrovec.name, linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH 8/8] cifs: clean up d_revalidate error return X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org If cifs_revalidate returns -ENOENT, then we know that the dentry should be invalidated and hence d_revalidate should return 0. Other errors however should be propagated back up to the caller. Signed-off-by: Jeff Layton --- fs/cifs/dir.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index e9f7ecc..6909b60 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -736,11 +736,15 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, static int cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) { + int rc; int isValid = 1; if (direntry->d_inode) { - if (cifs_revalidate_dentry(direntry)) - return 0; + rc = cifs_revalidate_dentry(direntry); + if (rc == -ENOENT) + isValid = 0; + else if (rc) + isValid = rc; } else { cFYI(1, ("neg dentry 0x%p name = %s", direntry, direntry->d_name.name));