From patchwork Fri Sep 7 14:18:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1422791 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8098D40AB4 for ; Fri, 7 Sep 2012 14:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760767Ab2IGOVv (ORCPT ); Fri, 7 Sep 2012 10:21:51 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:37611 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760755Ab2IGOTD (ORCPT ); Fri, 7 Sep 2012 10:19:03 -0400 Received: by vbbff1 with SMTP id ff1so3364273vbb.19 for ; Fri, 07 Sep 2012 07:19:02 -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=f9GVAU7HukoassRI4zyjRL8kdz7a9+tTSGrMXws6Nlc=; b=mugjS2HP8bRwIZJn9J/Zs29oG/APoufa4yKjQf5uEZDLZcHQZ2HqdXxDMmSJTV7bzK oy8SdHo0Fzz+6MacQrCnbY2JTLPZDx6+RXXStQ2z5l8VzQhK3hsxC15lxITKWyokhTKa ybuQ6kRDuh0qsB4cD4UettyUGSm92mGtcJBnDkz4RhNSAyGxneMW064+i48wg3lqG1Wl bnADea4GrHuWjsbneBPAg96iPGUO2ALFNR38ZGz5CtOlZtHaunD6ep+egh5k1xzqfrxm M1IwcxLZH7jlk6OrBF1KT0TvHi7Dgavj5kOHf1NUsoG1yZMXPvpmt0jg+E1luIQ/mX/C UoBA== Received: by 10.52.16.50 with SMTP id c18mr5923230vdd.76.1347027541882; Fri, 07 Sep 2012 07:19:01 -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.00 (version=SSLv3 cipher=OTHER); Fri, 07 Sep 2012 07:19:01 -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 17/20] vfs: make fchmodat retry once on ESTALE errors Date: Fri, 7 Sep 2012 10:18:24 -0400 Message-Id: <1347027507-20956-18-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: ALoCoQnPHJlQS4wsAaQ4PXkeyPGYUbUWQ8+LsBRq1UmuNawOXE8+5kXtXL2H2tTSWflBE3vfSSYP 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/open.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/open.c b/fs/open.c index a015cb8..232cbfb 100644 --- a/fs/open.c +++ b/fs/open.c @@ -506,12 +506,17 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode { struct path path; int error; + unsigned int try = 0; + int lookup_flags = LOOKUP_FOLLOW; - error = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path); - if (!error) { + do { + error = user_path_at(dfd, filename, lookup_flags, &path); + if (error) + break; error = chmod_common(&path, mode); path_put(&path); - } + lookup_flags |= LOOKUP_REVAL; + } while (retry_estale(error, try++)); return error; }