From patchwork Fri Sep 7 14:18:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1422721 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 8154DE00B1 for ; Fri, 7 Sep 2012 14:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760678Ab2IGOTh (ORCPT ); Fri, 7 Sep 2012 10:19:37 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:44055 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760784Ab2IGOTH (ORCPT ); Fri, 7 Sep 2012 10:19:07 -0400 Received: by mail-vb0-f46.google.com with SMTP id ff1so3364211vbb.19 for ; Fri, 07 Sep 2012 07:19:06 -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=EitbP9vh66lm4MQJxvlkWbLu7tUXfN9njPHNwT6wEQA=; b=KBOdICjKi7tJ6u+ZIsxV5IxIjzv3Lrzi1eiBHuKEnTfXRzW4zQO90bTEG9Q9XjtXKh TFuz6wEX40zNFxaO3xldgt/MBq8BzikZk5Pox2BhMUQMOaWZNs3nRgcs6hF35jvnxrEj AauGwD1MCK5QwstP5Jsn/GLBFquXeGCUOkJKHlVE6gtdvSwF8KyU98TU3QNRoBYa5ttn pn/RnnBMSRQ1klyPrXNP6wixhuqdTGmJQ68WyfHy+mdrs95KvonEwfGRNX22Ju0kv0QE PY95J7ZCY2hI6umsqmHtG2UMm60Ab1gIP/Mn2k8jKhwVlJFW3Orab/u/f++y9RCKyeYg ITEQ== Received: by 10.52.36.76 with SMTP id o12mr5170280vdj.40.1347027545045; Fri, 07 Sep 2012 07:19:05 -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.03 (version=SSLv3 cipher=OTHER); Fri, 07 Sep 2012 07:19:04 -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 19/20] vfs: convert do_filp_open to use retry_estale helper Date: Fri, 7 Sep 2012 10:18:26 -0400 Message-Id: <1347027507-20956-20-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: ALoCoQkZvRaI18rr1ysCI1wQDohTAjxNlLmMcZ0HNe26Pcis6PlesOpaIFP+T7hvuro+7Y952f2I 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 010d428..66b24fa 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3011,11 +3011,12 @@ struct file *do_filp_open(int dfd, struct getname_info *ginfo, { struct nameidata nd; struct file *filp; + unsigned int try = 0; filp = path_openat(dfd, ginfo, &nd, op, flags | LOOKUP_RCU); if (unlikely(filp == ERR_PTR(-ECHILD))) filp = path_openat(dfd, ginfo, &nd, op, flags); - if (unlikely(filp == ERR_PTR(-ESTALE))) + while (retry_estale(PTR_ERR(filp), try++)) filp = path_openat(dfd, ginfo, &nd, op, flags | LOOKUP_REVAL); return filp; }