From patchwork Thu Sep 22 17:39:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9346039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFF78607D0 for ; Thu, 22 Sep 2016 17:40:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B972628580 for ; Thu, 22 Sep 2016 17:40:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD93C2ABF2; Thu, 22 Sep 2016 17:40:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8641528580 for ; Thu, 22 Sep 2016 17:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935102AbcIVRkP (ORCPT ); Thu, 22 Sep 2016 13:40:15 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:34334 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965367AbcIVRkF (ORCPT ); Thu, 22 Sep 2016 13:40:05 -0400 Received: by mail-io0-f195.google.com with SMTP id y139so5621631ioy.1 for ; Thu, 22 Sep 2016 10:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=f0K1PoHJVdM8HOnoC8OXXZgXK/RmHY76oOrnU9jk6J0=; b=CD7T8yJ4GbLK0dzYBH4Mv/ZZzNTWUyP3f36fKN+6OMjRfXCr3yK/1givFgf0msgQcD 4aCNAa1QPxDGJMqC1EhUJMwgvhfEUdK+33YFDGZxDKaA2PQMWenqx6/5UWwFusT2fR2z aVuIPDgvK3xTcga1w42TLWJhpwBbQss8udm2oJa+rD0vA+pwfsRm0NWvFVawIEdlgVIt IC1hTGc42S4rsP64DHQclZQY3JseuaRq74e1/5fXe6w/m3IckFb+W1Az0YlxP44n/eNw 2QauqWowUr+BFIhjGcpEQepfTKBfwx7x0udpJdLabpEHfBYt4Jd/HSG69ZCHsa6W2R4G 6ucA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=f0K1PoHJVdM8HOnoC8OXXZgXK/RmHY76oOrnU9jk6J0=; b=VU4/FnfqEOKF69JTq5Ho1uw6ehzD1k9sT92ao00PJVzEJfjed3yr+EDu0v1GkSkem+ 8H4/KvRvfUJuBAwXYCG5DvCCaIur0QAKh6Ql4J7WQK8cYHT7mK6FVZCgS9d9/YzJeC9H z1dvCub/JQFf2oSOU8JDoRZ0UTjWoVN1ig5SiCxrSLGTBaUgNrkk3uZbdKbhQqBG88S9 ttdiQpyNgTRDEKrpifAXxnc8qYQprvMtfzW8S6hFOIcMO1fnzpvh/2jAwBEG4cxL3U82 /MDfoaSAwjd6HqP85YlcwvAGK3oNA/MXayjsTJblyxoBGJQReQjqle/DzcIez7Pc8G2D GEZQ== X-Gm-Message-State: AE9vXwMTGo/vmdt4dncre9ugeN6kcDZdLJnPyhW17ezS8DIoiTS1mcz1LwhWvekGN8G3JA== X-Received: by 10.107.152.74 with SMTP id a71mr4254104ioe.120.1474566004663; Thu, 22 Sep 2016 10:40:04 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (50-108-86-94.adr01.mskg.mi.frontiernet.net. [50.108.86.94]) by smtp.gmail.com with ESMTPSA id e66sm1194267itd.22.2016.09.22.10.40.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 10:40:04 -0700 (PDT) From: Trond Myklebust To: anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org, Oleg Drokin Subject: [PATCH v7 28/31] NFSv4: Open state recovery must account for file permission changes Date: Thu, 22 Sep 2016 13:39:18 -0400 Message-Id: <1474565961-21303-29-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474565961-21303-28-git-send-email-trond.myklebust@primarydata.com> References: <1474565961-21303-1-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-2-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-3-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-4-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-5-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-6-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-7-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-8-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-9-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-10-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-11-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-12-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-13-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-14-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-15-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-16-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-17-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-18-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-19-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-20-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-21-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-22-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-23-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-24-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-25-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-26-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-27-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-28-git-send-email-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the file permissions change on the server, then we may not be able to recover open state. If so, we need to ensure that we mark the file descriptor appropriately. Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust --- fs/nfs/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 4b538bb194f8..0a25f70a3b0b 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1532,6 +1532,9 @@ restart: __func__, status); case -ENOENT: case -ENOMEM: + case -EACCES: + case -EROFS: + case -EIO: case -ESTALE: /* Open state on this file cannot be recovered */ nfs4_state_mark_recovery_failed(state, status);