From patchwork Fri Sep 7 14:18:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1423021 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B0A7EDF283 for ; Fri, 7 Sep 2012 14:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932431Ab2IGO01 (ORCPT ); Fri, 7 Sep 2012 10:26:27 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:38668 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932117Ab2IGO01 (ORCPT ); Fri, 7 Sep 2012 10:26:27 -0400 Received: by ggdk6 with SMTP id k6so543330ggd.19 for ; Fri, 07 Sep 2012 07:26:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=mdQzemhgU3jDYw1YmwpFQKlmljADz3o2UvFRLdZTenw=; b=EnsVluf4aptT4hg1WXPi+UleorLfiEWRBEHRyiRPTKnOTt8vDS31+n7OQNLJM2TXs/ sFCJP8P6fSmKlXbt/f2fdzeTvtsHCBK9YOZ/lDZifdp7itzpOYJ9/VCAU0v5Aj3hggzH 8GGxeHGLBUIC/F9UdoiDybCsRjt6emTdASRk0n4sTPPnyNYjwwAdhoX0avqaHXGsFonw dmHCtUYWmhXlLCdu5F9dXse5npA6t722zxePvc4rqJuQCJRHqwrWgznYPaMViaNNFiha eoSJExkRkVBMrFUJuhuyd0BL+QxmUwFRO51oCNW21lB/7FrMIqz9DmL4fXp0Cf+wG1FP LpEw== Received: by 10.58.94.44 with SMTP id cz12mr8094470veb.34.1347027546635; Fri, 07 Sep 2012 07:19:06 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-069-134-145-027.nc.res.rr.com. [69.134.145.27]) by mx.google.com with ESMTPS id v9sm3207113ves.8.2012.09.07.07.19.05 (version=SSLv3 cipher=OTHER); Fri, 07 Sep 2012 07:19:05 -0700 (PDT) From: Jeff Layton To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, michael.brantley@deshaw.com, hch@infradead.org, miklos@szeredi.hu, pstaubach@exagrid.com Subject: [PATCH v6 20/20] vfs: convert do_file_open_root to use retry_estale helper Date: Fri, 7 Sep 2012 10:18:27 -0400 Message-Id: <1347027507-20956-21-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347027507-20956-1-git-send-email-jlayton@redhat.com> References: <1347027507-20956-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQmPGXbdmfIEIs8ELkVHVwGTpIOeee3mrIDz78SBF1bU1b6402v3F8AeMx+Kzq/yCBscQp9t Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Signed-off-by: Jeff Layton --- fs/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index 66b24fa..870352d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3027,6 +3027,7 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt, struct nameidata nd; struct file *file; struct getname_info ginfo = { .name = name }; + unsigned int try = 0; nd.root.mnt = mnt; nd.root.dentry = dentry; @@ -3039,7 +3040,7 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt, file = path_openat(-1, &ginfo, &nd, op, flags | LOOKUP_RCU); if (unlikely(file == ERR_PTR(-ECHILD))) file = path_openat(-1, &ginfo, &nd, op, flags); - if (unlikely(file == ERR_PTR(-ESTALE))) + while (retry_estale(PTR_ERR(file), try++)) file = path_openat(-1, &ginfo, &nd, op, flags | LOOKUP_REVAL); return file; }