Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5291054ybe; Tue, 10 Sep 2019 01:09:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvuHU3Wa/7ToHVr/S1P+JwsGVeKRSHiR3BxQsdHmCPtz3N9CWP0BJ9EUE+0TbR86gurYHf X-Received: by 2002:aa7:ca4e:: with SMTP id j14mr12373883edt.198.1568102998855; Tue, 10 Sep 2019 01:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568102998; cv=none; d=google.com; s=arc-20160816; b=C+MngOgwIFnK55UoPl925sQWtI4auecoRIGbX1FhrsbyJqTdlvCIp1D2jMx9yjjRBX QVZzh3cFcS1W4jX69px7wtXnxToD4gmBEJncwb6S9SQ2ez5dr48lAYoHvhcHUKtRDxEn JhzcUvy5gh/wPhksu97fnYXoA4I7OO900hWsnzT0MEnSLwh18M/teyxzbK+ZZQDryQRf 9JGEnNyWxatScfGgacnaem1Ar4z95xBV6NwMLSM5JS7v7RKEcskPldEkKdjwsu1RsZpD 0q8jz9frHgdxdjxfpUxKzlhNFO7c865KIo0NP9DrjI4A8xk/89tjvNYzT3XEKkbeSi8J rc8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tm3Z204lhcQueHhZs5vFp/leKoUofNIJTGBebGTHcyI=; b=mYQN6x0w4UK1ndWtXV7ZO38oy2Gpcg4Gb+ZPaaluKM33Ewl1eFgToNaMNS7LipUwpt xhYOZwvkN7HLyUk1ENDnUpCVPPJxnldEYiOb36bKJagunq5eGfYgim8xDdjeiAUZDLRP L3YPUABI/+vQ56D7LyUjB86rETU+soyrvWyo4Ew2pF3A/6ot6GYfGT/D/WjeNqWTsBW1 DXnnOWzBzevrrEw6RFCQq1kvKR8eDCYukduxuuNgbfAbyJrJI0F5Fs5XtIjsHtVjV40g 8MffFP/LMidaWhvwcLjuvUcZoJMwmq6xx8rgwAytZmRhT25Whqx5KyhqMTvXJ+RLySP1 GWxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l7yesDn0; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si8855148ejx.65.2019.09.10.01.09.34; Tue, 10 Sep 2019 01:09:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l7yesDn0; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405124AbfIIODU (ORCPT + 99 others); Mon, 9 Sep 2019 10:03:20 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:38649 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405126AbfIIODU (ORCPT ); Mon, 9 Sep 2019 10:03:20 -0400 Received: by mail-io1-f65.google.com with SMTP id k5so3601051iol.5 for ; Mon, 09 Sep 2019 07:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tm3Z204lhcQueHhZs5vFp/leKoUofNIJTGBebGTHcyI=; b=l7yesDn0PKJ0N97K2Q7aNFpVYN75fBcYJ7iEOHWfZdWDF//sP+Z6d9FpWjtnxcNSr+ gyDSjuDm80tNSretPry+2wSgGkQSpvtyohF5PWZd8qiJ1RwiUfrV/XfabFb2ViOA1yTW buOa3YIc0ylcpRHrh+lnIT8CstJZd2tCwQUQkellP9mSgzBxgXCfztqyaFiUviFEHJQ1 i1zHQnut3ZeX+A4FZlUrreINYeQQDFaq9OR9EZg8zR0ZXH9rYBtdLIHFDk1LMQ/4nkav 25A/acH1cGREZKhv3cxBGyBZ6tRPb/q8Eikv3kSTlbbpVqMWjPD/50nqNHpwHEvRfLZN q4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tm3Z204lhcQueHhZs5vFp/leKoUofNIJTGBebGTHcyI=; b=P8rsMSVAuxBXPfgwWGGVJOoNVFiR+N1bDNkiDVhhRkKy/pidvV/ehI70gMd66tkTq3 /OqIU5oDwkC/+oHrhZtPY+S2wYDSOJQ9orf5wMCzZiL4427cjCPj1x+skHQqYIijsm+7 u7jdLAOq0PTn0b11r8/zscAIEd0AmOeNv5qc5d8VQAy76bIiMEYxbEux/QxJp2mavZUB Mfdywj+WolTLlW+Ef80pMNfE4mZEMTsr1TnQQah1OjWtQejqKXCGBXzTH2ZMuOhcMt/Y 3XWqMhF50dC49/1oPZvEXBA89P0wXUC0qcjg8pmMipi6aAX6B0CwJy5CnWWwsRPU9sr4 hgBQ== X-Gm-Message-State: APjAAAWmXlLi/C3jP9F1EU7oHzDToG7is+H1YMzhvcX2XtF50h1xYebE 9IQSm7iXiviXbXixE4GX3lyRZGVQsg== X-Received: by 2002:a5d:9591:: with SMTP id a17mr14563566ioo.303.1568037799513; Mon, 09 Sep 2019 07:03:19 -0700 (PDT) Received: from localhost.localdomain (50-36-167-63.alma.mi.frontiernet.net. [50.36.167.63]) by smtp.gmail.com with ESMTPSA id h70sm33727176iof.48.2019.09.09.07.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2019 07:03:19 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 7/9] NFSv4: Fix OPEN_DOWNGRADE error handling Date: Mon, 9 Sep 2019 10:01:02 -0400 Message-Id: <20190909140104.78818-7-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190909140104.78818-6-trond.myklebust@hammerspace.com> References: <20190909140104.78818-1-trond.myklebust@hammerspace.com> <20190909140104.78818-2-trond.myklebust@hammerspace.com> <20190909140104.78818-3-trond.myklebust@hammerspace.com> <20190909140104.78818-4-trond.myklebust@hammerspace.com> <20190909140104.78818-5-trond.myklebust@hammerspace.com> <20190909140104.78818-6-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If OPEN_DOWNGRADE returns a state error, then we want to initiate state recovery in addition to marking the stateid as closed. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index cbaf6b7ac128..025dd5efbf34 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3394,7 +3394,9 @@ static void nfs4_close_done(struct rpc_task *task, void *data) task->tk_msg.rpc_cred); /* Fallthrough */ case -NFS4ERR_BAD_STATEID: - break; + if (calldata->arg.fmode == 0) + break; + /* Fallthrough */ default: task->tk_status = nfs4_async_handle_exception(task, server, task->tk_status, &exception); -- 2.21.0