Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1351808ybx; Thu, 31 Oct 2019 09:19:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF5DPgC1fPSY6ZBS6mGukvLUg3NeQ0TewlttYIh7QUiNi8Jad51z1rm9nIv037aTAaeRXZ X-Received: by 2002:a17:906:118d:: with SMTP id n13mr4778805eja.229.1572538763087; Thu, 31 Oct 2019 09:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572538763; cv=none; d=google.com; s=arc-20160816; b=Rr1isZbOodtyJ595DkaJvLNqC8MMq25PT3I4rH4kK7s8JtPQWk6iDfd4jqFlMfG5DQ PM2igj+EeYWlkw+g66Qtrrr7mz42hkykkYQ17jzX1pdtagrJyIW56G0lLRjWnv1l55aw 3eEk40SpYc95aOl2eew/y2m2/pmGnDOXW58cuMuqA60SP3nK7LeFseosDZtMhliLc7BF 5mxsEB9605jPWJ4tCeAA7ef1Ho5d0tl6Ui3zGxJn93VwtZwhlfW47q83iFoSMa67xTM4 rT2e1+cZ+cj4Sl1mTX+eYMXY/QR9tt13UktnDdWbX836/cQTvQ63nQp/XibNWdwfadDp sFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mBcC7geKiDVGBu18ige4z/8tIi8HnOkU+ln2+aW77c0=; b=QZyU6zD7yfJcJmLlRSunBN0yC+JP2s25Fak3ela0VSAN+C+7vc6J1n1oWbSoulDFoG UXdNOLwpvam7UYttyDg6BVd5Bay/qPLjiSu/+eV2/DmHjTfmG0nFzO5T6l72E4Odd0QE i8DQNLG1cot4+AfqW2z/G1s8duw2Oe7hLNkSGvjAVdRJYIBH9hhV6qTqQnrkiRJxDS+N 0Akbv6na49zdOe090YoOQh9l3nfebjBFrGBWk/06O7Q6MN/1/Ib5ABdl4nzek5Id7rZM f+AD77uGgKfsAmwVd+qNwoqlVHv6wNepUKcmJsxwiRPZECNvAEjjI8i7f5kpbKWoFrAY s66Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=Rj+CZQ24; 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=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si4120558ejv.130.2019.10.31.09.18.50; Thu, 31 Oct 2019 09:19: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=@umich.edu header.s=google-2016-06-03 header.b=Rj+CZQ24; 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=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727593AbfJaQP5 (ORCPT + 99 others); Thu, 31 Oct 2019 12:15:57 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:38904 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbfJaQP4 (ORCPT ); Thu, 31 Oct 2019 12:15:56 -0400 Received: by mail-ua1-f66.google.com with SMTP id u99so2052910uau.5 for ; Thu, 31 Oct 2019 09:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mBcC7geKiDVGBu18ige4z/8tIi8HnOkU+ln2+aW77c0=; b=Rj+CZQ245IOFx8uPGwIOyZ3UIycaUJ05a0WsLSzxtCHXE6SZ6GuLQHM+Vz06Dc/0ek hOAf2JqW5kHewFKvkp01l64M6jqHW/TsIBQyUKoiZXVHEY6JV4b8dB19XP4VR3XH8VGQ fnR0cJKB61DfPmXsY7VE9KJy14Co416NSc0RCJ4EeqlZRobWqika2I5YarTFR4MKkgaI O3mw+BU38SATeSK4sf/ozvIZRFitTfO7VCe5ZzBt4CygjgfYQzYtzua8IAVCP+6ICaS0 RgXtJlUWQeBhwEMIZGTHXas1TEWTvGVsc1oFO4d31bpDRTpJH8RT3/z9moZdPpMgiN0j W1Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mBcC7geKiDVGBu18ige4z/8tIi8HnOkU+ln2+aW77c0=; b=WYb1FAKyzrPFcxGXkM+xKgbYSus48tl1lTYPAPgo70lawtqG0dNlL3MEco0huLuRkh RIbpaXqmXIRpR9mAZO6d6bXMHPIuO7oH9YbnuE7o4wp2EGhQNI2ROj//yvDo2Rfh45wM amBYw+niOtxwFrZV1NCqOGlPqkFDZUnbwyEgataGnqSpqQcJ4CbBN50JEJXy67snfEVa 8hs2OSrPJaaG0WrxPMauBR4fO25rybgZC+M2TOhcO86yqqYq8FelXMBOkLN9UtUOrS47 Xjt7yV+Nr+KXK5SEzwij60JBZRTrfH1v1P1tBFttQBKCX8uGn5/1kKF/7iIO6PWJvBPL i+Qw== X-Gm-Message-State: APjAAAXWX4K0fzjrEAl+mgJjqrnBDsB9WXTSVvA2wnVICXH9OsgTIJzj XHKaa0M798wblCtS4D8ff8SfqbEN7AoE2p/O1bk= X-Received: by 2002:ab0:5949:: with SMTP id o9mr3193173uad.65.1572538555475; Thu, 31 Oct 2019 09:15:55 -0700 (PDT) MIME-Version: 1.0 References: <20191023235600.10880-1-trond.myklebust@hammerspace.com> In-Reply-To: From: Olga Kornievskaia Date: Thu, 31 Oct 2019 12:15:44 -0400 Message-ID: Subject: Re: [PATCH 00/14] Delegation bugfixes To: Trond Myklebust Cc: linux-nfs Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Trond, Now that I recall the reason the Ontap server gives out the same delegation was to deal with the linux client behaviour who sends an open even though it holds a delegation (according to the server's view). So what server does is it gives out the same delegation. This patch series changes the semantics. Can you describe what you expect the server is supposed to do in this case? On Thu, Oct 31, 2019 at 11:49 AM Olga Kornievskaia wrote: > > On Thu, Oct 31, 2019 at 11:27 AM Olga Kornievskaia wrote: > > > > Hi Trond, > > > > This patch set produces the following in my testing. Basically what I > > see the client is prevented from using a delegation at all. > > > > After I induce a race of DELEGRETURN/OPEN > > --- the racing OPEN gets a delegation (it returns the same seqid and > > other as the delegation being returned) but the client doesn't use it. > > --- the following (next) OPEN that also gets a delegation immediately > > has the client returning the given delegation. > > > > Disclaimer: in my testing the racing DELEGRETURN doesn't fail with > > OLD_STATEID, NetApp returns OK. > > Testing the same against Linux. It prevents the client from using > future delegation stateid. On the induced DELEGRETURN/OPEN race, the > linux server doesn't give a new read delegation. The following open > gets a read delegation and returns it right away. > > > > On Thu, Oct 24, 2019 at 6:56 AM Trond Myklebust wrote: > > > > > > The following patchset fixes up a number of issues with delegations, > > > but mainly attempts to fix a race condition between open and > > > delegreturn, where the open and the delegreturn get re-ordered so > > > that the delegreturn ends up revoking the delegation that was returned > > > by the open. > > > The root cause is that in certain circumstances, we may currently end > > > up freeing the delegation from delegreturn, so when we later receive > > > the reply to the open, we've lost track of the fact that the seqid > > > predates the one that was returned. > > > > > > This patchset fixes that case by ensuring that we always keep track > > > of the last delegation stateid that was returned for any given inode. > > > That way, if we later see a delegation stateid with the same opaque > > > field, but an older seqid, we know we cannot trust it, and so we > > > ask to replay the OPEN compound. > > > > > > Trond Myklebust (14): > > > NFSv4: Don't allow a cached open with a revoked delegation > > > NFSv4: Fix delegation handling in update_open_stateid() > > > NFSv4: nfs4_callback_getattr() should ignore revoked delegations > > > NFSv4: Delegation recalls should not find revoked delegations > > > NFSv4: fail nfs4_refresh_delegation_stateid() when the delegation was > > > revoked > > > NFS: Rename nfs_inode_return_delegation_noreclaim() > > > NFSv4: Don't remove the delegation from the super_list more than once > > > NFSv4: Hold the delegation spinlock when updating the seqid > > > NFSv4: Clear the NFS_DELEGATION_REVOKED flag in > > > nfs_update_inplace_delegation() > > > NFSv4: Update the stateid seqid in nfs_revoke_delegation() > > > NFSv4: Revoke the delegation on success in nfs4_delegreturn_done() > > > NFSv4: Ignore requests to return the delegation if it was revoked > > > NFSv4: Don't reclaim delegations that have been returned or revoked > > > NFSv4: Fix races between open and delegreturn > > > > > > fs/nfs/callback_proc.c | 2 +- > > > fs/nfs/delegation.c | 109 +++++++++++++++++++++++++++++------------ > > > fs/nfs/delegation.h | 4 +- > > > fs/nfs/nfs4proc.c | 13 ++--- > > > fs/nfs/nfs4super.c | 4 +- > > > 5 files changed, 88 insertions(+), 44 deletions(-) > > > > > > -- > > > 2.21.0 > > >