Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2051441pxu; Tue, 24 Nov 2020 15:56:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjgSBX5AHqJwB8QSYgJtKj4Tsm2DFlFsXhi4ddQX5G/fwnDV6HNL402PrlULE1x3oVubml X-Received: by 2002:a05:6402:1a2b:: with SMTP id be11mr1008062edb.353.1606262210139; Tue, 24 Nov 2020 15:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262210; cv=none; d=google.com; s=arc-20160816; b=hCfeh4A7yjwILb8plScqxJe9Rp72vddUb7Vpvy/jNcDU3Quk6vSIPP8BvqX5HOOg+8 ROvVRXWInTWbWY3C4K4Pt6X0WOBSmlFC35hWGdrDqiYP86uujLyr45p/SFQk1MEol7Xl qvAQpL+CGy6+qLr320qmS6Ixa6yW59YSe4wRJdjI5LsDGUucAtxEUuqpNZQK39Kfew7s R++wGCcrilgB9zUx0MC4VHpBVAOERdm9LH1tc3mMIw+1nni+qyvC4v04alJyMFK3nCHH YDmsfVlEIZbwDdMKm/o5k+wAlyfIuAW9WATUGXBUfqyHjxrEDE1VRoDvz6hhWfse6BaJ R6qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=aGxvlEg3oVDYTcBgT6zw8DLo/AL57tGEfqiQpngLLKk=; b=yglSo9zYMclRowS0VxCC6EKi9ZjtRjugFABYjtrqVaxpqNS5vntmRbHR9oj+FBLUVt mVpDE/Wk2zYlMNdZZfJ4fuJfifFzie6WBUTI98FO6J2axOLlu0tNcEYrOHxwy0EE2Spb UT3rqqAsUb8PiwIK3c7w0ALfmZaPxk+GQ5D6PdxZzIpSlAKmopXhLB0A+TcAzrEXZiP0 KKRF+LxAt7AyhKBppHDSgVG7/ixFmqv91u51F1IcwabJ9iRJtsqthaInrb7UD9F28ub3 M6yI4b1gbWgCT/1BL+n/m1VLbx6JRje1rvTOKlZUfBkyiRWkrZ7E1BNfiasrgfzDLWPa eTOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=c5EOicYz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si325035eju.388.2020.11.24.15.56.27; Tue, 24 Nov 2020 15:56:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=c5EOicYz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbgKXUt6 (ORCPT + 99 others); Tue, 24 Nov 2020 15:49:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726256AbgKXUt6 (ORCPT ); Tue, 24 Nov 2020 15:49:58 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFA18C0613D6 for ; Tue, 24 Nov 2020 12:49:57 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id BB75D6E9E; Tue, 24 Nov 2020 15:49:56 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org BB75D6E9E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1606250996; bh=aGxvlEg3oVDYTcBgT6zw8DLo/AL57tGEfqiQpngLLKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c5EOicYzvQs0iG4Mr8/QDoY29jUrwi+GkEMaIdiPgbeJTXoYZtRyQjTat+hRf8J8m Wu4buljs/zxrah8TkeEry//lD23iFVvBDSnYG2djFGIFOmiRUbKnRIfMcMAF1aoSKA dNWlkQckFroPErfMNCkG8N0Y1qqvGlpJDoBi0/dA= Date: Tue, 24 Nov 2020 15:49:56 -0500 From: "J. Bruce Fields" To: Dai Ngo Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH] NFSD: Fix 5 seconds delay when doing inter server copy Message-ID: <20201124204956.GB7173@fieldses.org> References: <20201124031609.67297-1-dai.ngo@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124031609.67297-1-dai.ngo@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Nov 23, 2020 at 10:16:09PM -0500, Dai Ngo wrote: > Since commit b4868b44c5628 ("NFSv4: Wait for stateid updates after > CLOSE/OPEN_DOWNGRADE"), every inter server copy operation suffers 5 > seconds delay regardless of the size of the copy. The delay is from > nfs_set_open_stateid_locked when the check by nfs_stateid_is_sequential > fails because the seqid in both nfs4_state and nfs4_stateid are 0. > > Fix by modifying the source server to return the stateid for COPY_NOTIFY > request with seqid 1 instead of 0. This is also to conform with > section 4.8 of RFC 7862. > > Here is the relevant paragraph from section 4.8 of RFC 7862: > > A copy offload stateid's seqid MUST NOT be zero. In the context of a > copy offload operation, it is inappropriate to indicate "the most > recent copy offload operation" using a stateid with a seqid of zero > (see Section 8.2.2 of [RFC5661]). It is inappropriate because the > stateid refers to internal state in the server and there may be > several asynchronous COPY operations being performed in parallel on > the same file by the server. Therefore, a copy offload stateid with > a seqid of zero MUST be considered invalid. > > Fixes: ce0887ac96d3 ("NFSD add nfs4 inter ssc to nfsd4_copy") > Signed-off-by: Dai Ngo > --- > fs/nfsd/nfs4state.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index d7f27ed6b794..33ee1a6961e3 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -793,6 +793,7 @@ struct nfs4_cpntf_state *nfs4_alloc_init_cpntf_state(struct nfsd_net *nn, > refcount_set(&cps->cp_stateid.sc_count, 1); > if (!nfs4_init_cp_state(nn, &cps->cp_stateid, NFS4_COPYNOTIFY_STID)) > goto out_free; > + cps->cp_stateid.stid.si_generation = 1; This affects the stateid returned by COPY_NOTIFY, but not the one returned by COPY. I think we wan to add this to nfs4_init_cp_state() and cover both. --b. > spin_lock(&nn->s2s_cp_lock); > list_add(&cps->cp_list, &p_stid->sc_cp_list); > spin_unlock(&nn->s2s_cp_lock); > -- > 2.9.5