Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp968095pxu; Mon, 23 Nov 2020 08:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEoiZoa8Vs/+HCCiQDv4INR+UTgPZGJiJ+xr3IB3JC+xXyFUd1T8vrJFwfK5dSqZQky6KP X-Received: by 2002:a17:906:d41:: with SMTP id r1mr326933ejh.383.1606148864432; Mon, 23 Nov 2020 08:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606148864; cv=none; d=google.com; s=arc-20160816; b=HGJCbP4pY5kdr5M821AP6chxOJil1N5FbpoR5Zp6HtDh66Fu5z+RXFmAp6p7vF4F/1 zC/KcNfQi4CEF/yd8bQ8MDFEkFvwJWPW5jmY7rOI+q3lYjq97yav1C3WzJuvHocID5Fg FRprDpNDVVYUsfiNFt7Mkv+GqJyUHxb8UtK1t2TMFzXXrrye6OxDrnIyKKqVk/7RyV2P vjOWX7ZuQhqBnuATFTX/i2pXHvvh48DYh3NLBOu8gMGvVt7O8T9EEAi56hnWGv3KG5eP VDiPeh9ui9wKmjJ9HK96lxhWHDD4duM/dQhA8B17ANnjlAH/BaRwGkORGuXKgiizdRe+ iwIg== 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=6JWvJVhnl2w/ar3QiqzE0ljPenCIrSVzH4XNwrKMGKw=; b=0kRB0TI48fDtJyCpRukYAPn06xf16CwxCHdACdwPoV9hzIATnolo0Kj9S0JxRhOIXG yrgVwt2NOJzMViziB377bs8I2Q/YtmRz3cJAk0l5iCsmggx6+NXM9GG/gqNZrjTnP/T4 +2E3fsZspKKG2Ad01aQHNkUTk3LQngMav5K6Z0Z3gJzW6R6T2wmU/vdqnAol3kqBKmGT N+6lehsAYfqsp1RTymoopZThHWinNlA3akDUZ078r8Is/nkbByg07WIyUUYXG30OooJW UzCCDTt13E7O6Q0zCw71W1b+lByrmFYBPUpqXhWq+wX/uC2NtdpjnwCGaegHzFgKGPXR 7p6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b="L5HdxZ/m"; 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 d9si6924997edv.558.2020.11.23.08.27.20; Mon, 23 Nov 2020 08:27:44 -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="L5HdxZ/m"; 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 S2389957AbgKWQZQ (ORCPT + 99 others); Mon, 23 Nov 2020 11:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730953AbgKWQZP (ORCPT ); Mon, 23 Nov 2020 11:25:15 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788E8C0613CF for ; Mon, 23 Nov 2020 08:25:15 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 928166EA1; Mon, 23 Nov 2020 11:25:14 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 928166EA1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1606148714; bh=6JWvJVhnl2w/ar3QiqzE0ljPenCIrSVzH4XNwrKMGKw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L5HdxZ/mcxpEEHYs5PE5k93c7RhRSy3kg8jueHFJWXgX+lECIqxp/Mm8CznNuZrY3 Cwmcqt9kzzpA3+lLq1Q3AT7Stn9sP3pIORDi1x5sTFBd+rVoF1QCLUjFSJ+gk2UxJO VCkLWoiBZ45/FOFzHiopVE+f5T+f95wWIx3bn7dU= Date: Mon, 23 Nov 2020 11:25:14 -0500 From: "J. Bruce Fields" To: Dai Ngo Cc: Olga Kornievskaia , linux-nfs Subject: Re: [PATCH v4 1/1] NFSv4.2: Fix NFS4ERR_STALE error when doing inter server copy Message-ID: <20201123162514.GF32599@fieldses.org> References: <20201109204206.GA20261@fieldses.org> <7a18452a-3120-ea5b-f676-9d7e18a65446@oracle.com> <470b690f-c919-2c48-95b7-18cc75f71f70@oracle.com> <20201110201239.GA17755@fieldses.org> <20201110215157.GB17755@fieldses.org> <20201110222155.GC17755@fieldses.org> <5b395908-8cd4-f93d-421e-68608235b863@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5b395908-8cd4-f93d-421e-68608235b863@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Nov 11, 2020 at 03:02:19PM -0800, Dai Ngo wrote: > > On 11/10/20 2:21 PM, J. Bruce Fields wrote: > >On Tue, Nov 10, 2020 at 05:08:59PM -0500, Olga Kornievskaia wrote: > >>On Tue, Nov 10, 2020 at 4:52 PM J. Bruce Fields wrote: > >>>On Tue, Nov 10, 2020 at 04:07:41PM -0500, Olga Kornievskaia wrote: > >>>>On Tue, Nov 10, 2020 at 3:14 PM J. Bruce Fields wrote: > >>>>>On Mon, Nov 09, 2020 at 10:46:12PM -0800, Dai Ngo wrote: > >>>>>>On 11/9/20 2:26 PM, Dai Ngo wrote: > >>>>>>>On 11/9/20 12:42 PM, J. Bruce Fields wrote: > >>>>>>>>On Mon, Nov 09, 2020 at 11:34:08AM -0800, Dai Ngo wrote: > >>>>>>>>>On 11/9/20 10:30 AM, J. Bruce Fields wrote: > >>>>>>>>>>On Tue, Oct 20, 2020 at 11:34:35AM -0700, Dai Ngo wrote: > >>>>>>>>>>>On 10/20/20 10:01 AM, J. Bruce Fields wrote: > >>>>>>>>>>>>On Sun, Oct 18, 2020 at 11:42:49PM -0400, Dai Ngo wrote: > >>>>>>>>>>>>>NFS_FS=y as dependency of CONFIG_NFSD_V4_2_INTER_SSC still have > >>>>>>>>>>>>>build errors and some configs with NFSD=m to get NFS4ERR_STALE > >>>>>>>>>>>>>error when doing inter server copy. > >>>>>>>>>>>>> > >>>>>>>>>>>>>Added ops table in nfs_common for knfsd to access NFS > >>>>>>>>>>>>>client modules. > >>>>>>>>>>>>OK, looks reasonable to me, applying. Does this resolve all the > >>>>>>>>>>>>problems you've seen, or is there any bad case left? > >>>>>>>>>>>Thanks Bruce. > >>>>>>>>>>> > >>>>>>>>>>>With this patch, I no longer see the NFS4ERR_STALE in any config. > >>>>>>>>>>> > >>>>>>>>>>>The problem with NFS4ERR_STALE was because of a bug in > >>>>>>>>>>>nfs42_ssc_open. > >>>>>>>>>>>When CONFIG_NFSD_V4_2_INTER_SSC is not defined, nfs42_ssc_open > >>>>>>>>>>>returns NULL which is incorrect allowing the operation to continue > >>>>>>>>>>>until nfsd4_putfh which does not have the code to handle > >>>>>>>>>>>nfserr_stale. > >>>>>>>>>>> > >>>>>>>>>>>With this patch, when CONFIG_NFSD_V4_2_INTER_SSC is not defined the > >>>>>>>>>>>new nfs42_ssc_open returns ERR_PTR(-EIO) which causes the NFS client > >>>>>>>>>>>to switch over to the split copying (read src and write to dst). > >>>>>>>>>>That sounds reasonable, but I don't see any of the patches you've sent > >>>>>>>>>>changing that error return. Did I overlook something, or did you mean > >>>>>>>>>>to append a patch to this message? > >>>>>>>>>Since with the patch, I did not run into the condition where > >>>>>>>>>NFS4ERR_STALE > >>>>>>>>>is returned so I did not fix this return error code. Do you want me to > >>>>>>>>>submit another patch to change the returned error code from > >>>>>>>>>NFS4ERR_STALE > >>>>>>>>>to NFS4ERR_NOTSUPP if it ever runs into that condition? > >>>>>>>>That would be great, thanks. (I mean, it is still possible to hit that > >>>>>>>>case, right? You just didn't test with !CONFIG_NFSD_V4_2_INTER_SSC ?) > >>>>>>>will do. I did tested with (!CONFIG_NFSD_V4_2_INTER_SSC) but did not hit > >>>>>>>this case. > >>>>>>I need to qualify this, the copy_file_range syscall did not return > >>>>>>ESTALE in the test. > >>>>>> > >>>>>>>Because with this patch, when CONFIG_NFSD_V4_2_INTER_SSC is not > >>>>>>>defined the new nfs42_ssc_open returns ERR_PTR(-EIO), instead of NULL in > >>>>>>>the old code, which causes the NFS client to switch over to the split > >>>>>>>copying (read src and write to dst). > >>>>>>This is not the reason why the client switches to generic_copy_file_range. > >>>>>> > >>>>>>>Returning NULL in the old nfs42_ssc_open is not correct, it allows > >>>>>>>the copy > >>>>>>>operation to proceed and hits the NFS4ERR_STALE case in the COPY > >>>>>>>operation. > >>>>>>I retested with (!CONFIG_NFSD_V4_2_INTER_SSC) and saw NFS4ERR_STALE > >>>>>>returned for the PUTFH of the SRC in the COPY compound. However on the > >>>>>>client nfs42_proc_copy (with commit 7e350197a1c10) replaced the ESTALE > >>>>>>with EOPNOTSUPP causing nfs4_copy_file_range to use generic_copy_file_range > >>>>>>to do the copy. > >>>>>> > >>>>>>The ESTALE error is only returned by copy_file_range if the client > >>>>>>does not have commit 7e350197a1c10. So I think there is no need to > >>>>>>make any change on the source server for the NFS4ERR_STALE error. > >>>>>I don't believe NFS4ERR_STALE is the correct error for the server to > >>>>>return. It's nice that the client is able to do the right thing despite > >>>>>the server returning the wrong error, but we should still try to get > >>>>>this right on the server. > >>>>Hi Bruce, > >>>> > >>>>ERR_STALE is the appropriate error to be returned by the server that > >>>>gets a COPY compound when it doesn't support COPY. Since server can't > >>>>understand the filehandle so it can't process it so we can't get to > >>>>processing COPY opcode where the server could have returned > >>>>EOPNOTSUPP. > >>>The case we're discussing is the case where we support COPY but not > >>>server-to-server copy. > >>My point is still the same, that's an appropriate error for when > >>server-to-server copy is not supported. > >Uh, OK, if it backs up and returns it to the PUTFH, I guess? > > > >Was it really the intention of nfsd4_do_async_copy() that it return > >STALE in the case NFS42_ssc_open() returns NULL? That's pretty > >confusing. > > In this scenario, the COPY compound fails at the PUTFH op and > NFS4ERR_NOTSUPP is not a valid error code for PUTFH, NFS4ERR_STALE is. OK, makes sense. I've lost track of what's left to apply. --b.