Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1545539ybj; Fri, 20 Sep 2019 12:13:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzmX6dge4Fsl5NQr6ADAXeNAaubX6XT2Qc0bGsacSAzMIG6d8i1E6e/kTh9WkV7XY0pl2C X-Received: by 2002:a17:906:8319:: with SMTP id j25mr13507671ejx.122.1569006803211; Fri, 20 Sep 2019 12:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569006803; cv=none; d=google.com; s=arc-20160816; b=x8e1P7hL9kurIyZGOq8+WKGneQElbGutw/sUSUuNrvTUAmGzY3mjf11ViFDXywkiPv I3K68NTXwG/w+MMGoAVVXmfRLXhcEtyef4aVBx9rn0HGVxRMxc+6XKvRTo5VOtHE+6kk NjW2ie9IyUyVlge+/aUZp47L5oFgbU9Scudy6veak1KhM+yQ1VMqoP861iDpxpp3moy7 4YdApLbc6nI3mxuM4QaN1RwSvEHfb14UPBYT8r4tyZn0ejZY6mHuJ3fD4vOU9Mw8x644 zO9fphqugdl2jkatEedUzPly9AIAstVhi28vrTFcFoe5np8O9X0jQmUZemqN43JtNd7R Pyag== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=VZrKbzdxU387h76wC3NwBRGveE+UFgnDwEMlzw/LMS0=; b=PEqqdxQyUhgSRW4ue4QfNtil8S9BsiaV7hONuMuAg2LmdOf4FyB+xrTD+pXTzJgNwc JsAY52DTtJfJFlC89aX4nn0+vCrgVvZTzePoTkfFVlJWHHuTuFDQ+3IRVO36Y6ORiJIJ 5dRY/teEtQNtRkhrom+R8dIQ5kVKRBTDtgeYVSeG70trDf0d25v95rrVC9O0/a2c0XBr QvoOsQCK55HXBRRNu8nOmJSaqg9H3zkEFhGZrGaEdO/xDGPrRLIp0YdN5qkJ1rRw/P6t k/6pk++FY0Ul65ArPa+J3lC5W+dRwz1MzHkV+rPnLvssRrobrfa3n812iDLCuSNqkGzz hdSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="tRDJi/Oy"; 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 b9si1885449eda.129.2019.09.20.12.12.57; Fri, 20 Sep 2019 12:13:23 -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="tRDJi/Oy"; 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 S2438177AbfITLZ6 (ORCPT + 99 others); Fri, 20 Sep 2019 07:25:58 -0400 Received: from mail-io1-f43.google.com ([209.85.166.43]:40465 "EHLO mail-io1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438173AbfITLZ6 (ORCPT ); Fri, 20 Sep 2019 07:25:58 -0400 Received: by mail-io1-f43.google.com with SMTP id h144so15276018iof.7 for ; Fri, 20 Sep 2019 04:25:58 -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:mime-version :content-transfer-encoding; bh=VZrKbzdxU387h76wC3NwBRGveE+UFgnDwEMlzw/LMS0=; b=tRDJi/OyZORWgjeBRKKm/vrNwFTIUQkOymaypR+qRpdC0KUrVVIswFeEkNd0ZyAaj8 DcbZE3cR6DD6oM2xh7OFf8As/01cUVhpGWuBGlPQEuoK2wsIn40zCciviQ9FErOiM2RF se+NOI15wyBw7kLIs9rFxrFom+noKgnbnsKL5/wUbf9dCu52BoQWLdXJQUwH2xyysuWQ 8zyLr0ERz4LvUowNJKZQ1b1LKy59B58PmsJ57Vx2Sj8z2X/bLk7vewdGfxIg15AHMVqa Efe9ggj8KG/a+c2Lg69JwY8M8VPgZtJ1Ve/dt+8hB9vkOq3HtdNVQPV8j3aoadnvnvYB 9mVw== 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:mime-version :content-transfer-encoding; bh=VZrKbzdxU387h76wC3NwBRGveE+UFgnDwEMlzw/LMS0=; b=Df8kFrXN6yW3TOizZvqPQ3oZPQlLXJgfgMwxQ94v1oo1mohvW5LnDLXP2cKkeEwr7d 2cx2cLuYuqJM3XRqu6YbkGxW4b9cIKUu8TXUgSFEX32WePulXIhjmS/XeagWMPxRzBjb 5gbXfA3FoQZ49/0WaoayzElOO43hL9RnyGF9UVyvEg7w2vZguJWLJ74BVcNx4UCatnGo gWLnrm8miaCbbSaAUuHNEIjuAAYxFbazr7/XtQQhwmTr2yvhny8G7bZj+pXtZfnue3bu lrguia/pFQhsZJZWiIXXaQk5jdcMF7JuIy9jQMITfP2g7x0ZddLXqV58c5dMHuRmwBEU X7Mw== X-Gm-Message-State: APjAAAXo6OB7ktm7QLoTeMVYui6BdT8PpkkU0+UrtUjNrc0Nou+V0Zyw G3EpVMoCPaj4qZ47ktpggcTf9+QxNQ== X-Received: by 2002:a6b:6013:: with SMTP id r19mr18277099iog.94.1568978757342; Fri, 20 Sep 2019 04:25:57 -0700 (PDT) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id q74sm1308736iod.72.2019.09.20.04.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 04:25:56 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: Olga Kornievskaia , linux-nfs@vger.kernel.org Subject: [PATCH v3 0/9] Various NFSv4 state error handling fixes Date: Fri, 20 Sep 2019 07:23:39 -0400 Message-Id: <20190920112348.69496-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 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 Various NFSv4 fixes to ensure we handle state errors correctly. In particular, we need to ensure that for COMPOUNDs like CLOSE and DELEGRETURN, that may have an embedded LAYOUTRETURN, we handle the layout state errors so that a retry of either the LAYOUTRETURN, or the later CLOSE/DELEGRETURN does not corrupt the LAYOUTRETURN reply. Also ensure that if we get a NFS4ERR_OLD_STATEID, then we do our best to still try to destroy the state on the server, in order to avoid causing state leakage. v2: Fix bug reports from Olga - Try to avoid sending old stateids on CLOSE/OPEN_DOWNGRADE when doing fully serialised NFSv4.0. - Ensure LOCKU initialises the stateid correctly. v3: Fix locking - Ensure the patch "Handle NFS4ERR_OLD_STATEID in LOCKU" locks the stateid when copying it in nfs4_alloc_unlockdata(). Trond Myklebust (9): pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors NFSv4: Clean up pNFS return-on-close error handling NFSv4: Handle NFS4ERR_DELAY correctly in return-on-close NFSv4: Handle RPC level errors in LAYOUTRETURN NFSv4: Add a helper to increment stateid seqids pNFS: Handle NFS4ERR_OLD_STATEID on layoutreturn by bumping the state seqid NFSv4: Fix OPEN_DOWNGRADE error handling NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE NFSv4: Handle NFS4ERR_OLD_STATEID in LOCKU fs/nfs/nfs4_fs.h | 11 ++- fs/nfs/nfs4proc.c | 209 +++++++++++++++++++++++++++++++-------------- fs/nfs/nfs4state.c | 16 ---- fs/nfs/pnfs.c | 71 +++++++++++++-- fs/nfs/pnfs.h | 17 +++- 5 files changed, 233 insertions(+), 91 deletions(-) -- 2.21.0