From patchwork Fri Sep 7 14:18:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1422711 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 67639DF283 for ; Fri, 7 Sep 2012 14:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760322Ab2IGOTe (ORCPT ); Fri, 7 Sep 2012 10:19:34 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:43357 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760781Ab2IGOTH (ORCPT ); Fri, 7 Sep 2012 10:19:07 -0400 Received: by mail-vb0-f46.google.com with SMTP id ff1so3363754vbb.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=TWZMAsKgiK0XZeeE8KLqfJ93lQwdLoFB+cRp3DLvsLo=; b=LUn3aUvDtA4bi4cAo2SvZa+vzl0YGmPjejXnu9Gqfg7pwbaA2gSmZv8SnR95e1/fRq qPeZY255//rEHA9e4nzHx049lJ3TFFwu9wjL/hVEEC/RzbHEpJZJvAYZbQZnQJU34Gz1 AGq8zqHiocXsfjv6nAoYymB/2Hr1VsfeqeC7GHuNIs2FtGOJmTGYqfXqD/EuBpquOrJf RLcmoLHzDJeXSTw1EsVcSiViOgc/0z4OSzTmgEuKNuG1HIzBqzmSsHUVGKBCmyLRqb6c KH6+Z3JtFJbem8L74eiDJtV16PalpSH2mGjb0kG8vv73GM+szz7RZ/dmkzGHgm3kXO48 g1iA== Received: by 10.52.69.106 with SMTP id d10mr5964256vdu.111.1347027532767; Fri, 07 Sep 2012 07:18:52 -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.18.51 (version=SSLv3 cipher=OTHER); Fri, 07 Sep 2012 07:18:52 -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 11/20] vfs: make do_unlinkat retry on ESTALE errors Date: Fri, 7 Sep 2012 10:18:18 -0400 Message-Id: <1347027507-20956-12-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: ALoCoQkY0nb2ObaD0U8MLZLqLeJg5ioFo+PuYD2Bnxt8qad9Kq9iSKgLU8iWxIuHc69k49Qapzuj 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index a9dd63f..77c2b1055 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3446,8 +3446,11 @@ static long do_unlinkat(int dfd, const char __user *pathname) struct dentry *dentry; struct nameidata nd; struct inode *inode = NULL; + unsigned int try = 0; + unsigned int lookup_flags = LOOKUP_PARENT; - name = user_path_parent(dfd, pathname, &nd, 0); +retry: + name = user_path_parent(dfd, pathname, &nd, try); if (IS_ERR(name)) return PTR_ERR(name); @@ -3485,6 +3488,10 @@ exit2: exit1: path_put(&nd.path); putname(name); + if (retry_estale(error, try++)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } return error; slashes: