Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp999431ybp; Thu, 17 Oct 2019 06:40:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/CW0DA7TVF702UHlpyHe2Ex22ACqFBMYxLZxv+/K56CEMiXt0W+WH7/A3LXIWqUlpfrbL X-Received: by 2002:a17:906:6847:: with SMTP id a7mr3518816ejs.261.1571319635016; Thu, 17 Oct 2019 06:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571319635; cv=none; d=google.com; s=arc-20160816; b=fAcW8CkqkvojLNuUItzAku5jb6ELe7kunNVRVh/lcuS/vLuVplVhYo7k+GJoEhogw7 xJtslBEoR2174BV25rSHK1mszVfDj92/vgolD0jCHMEpozGmdVDf2EkeycKoXi1DrICO qeTnaf2Rm6f8WNbB6c9RJaoKQEu0hqkvMEaDHt/3VT256JCeQDjImzv7wcgyXy1P5edv R1swveQZlTjKaXPOCtdy3O5iPmmAWvr6onY9Fh/C5057GSFeE81UFxvMsfRvBtDcZMHk XC6jEinIx3brs8kKeF1nZhgjdlaEq5vbIWzQSPTvpKyBnOtPvljQ4tphs9q/6RsrQT4T 3kUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lhmyCbPQ4kNESqcugslOSwPT2XCoYSCTLjr+IJBRAa8=; b=saRSrTQm7aPlxx/YGGg0LD4I51eiuYdwSE3ujscJ6rLDYuA4MbspoNGsiaY2d5nc0T vq5eXyr1qG8rfHAgrI8kA/LcJZQXDVR0jgpkmulEmdxdQui9c5eOIu8TAjQoJoLms1c9 zL/bSxnYkyYIx891MmKbi7RZnsbApLRSK3NNd1MfZJNRsrCYYlA4/1j1MhDqirfXKMad FQQnJNFUJfAfZcgTEaBnKcI51nZtxdKkbjZCGRlMevRIUIuDe6Mn7sQL8SfAK3R13UvI 8QPJsU2TvajzG8wrWgOgZnpN9wXjtlFafuV1SNUT7K49eg9wlzdvaZ/BOTRxWGW1Booj 8uXw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16si1587708edb.341.2019.10.17.06.40.02; Thu, 17 Oct 2019 06:40:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437166AbfJPUbv (ORCPT + 99 others); Wed, 16 Oct 2019 16:31:51 -0400 Received: from fieldses.org ([173.255.197.46]:36544 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728881AbfJPUbv (ORCPT ); Wed, 16 Oct 2019 16:31:51 -0400 Received: by fieldses.org (Postfix, from userid 2815) id B2BCEBDB; Wed, 16 Oct 2019 16:31:50 -0400 (EDT) Date: Wed, 16 Oct 2019 16:31:50 -0400 From: "J. Bruce Fields" To: "Kornievskaia, Olga" Cc: Rick Macklem , "linux-nfs@vger.kernel.org" Subject: Re: NFSv4.2 server replies to Copy with length == 0 Message-ID: <20191016203150.GC17543@fieldses.org> References: <20191016155838.GA17543@fieldses.org> <31E6043B-090D-4E37-B66F-A45AC0CFC970@netapp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <31E6043B-090D-4E37-B66F-A45AC0CFC970@netapp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Oct 16, 2019 at 07:53:45PM +0000, Kornievskaia, Olga wrote: > On 10/16/19, 11:58 AM, "J. Bruce Fields" wrote: > On Wed, Oct 16, 2019 at 06:22:42AM +0000, Rick Macklem wrote: > > It seems that the Copy reply with wr_count == 0 occurs when the > > client sends a Copy request with ca_src_offset beyond EOF in the > > input file. (It happened because I was testing an old/broken > > version of my client, but I can reproduce it, if you need a > > bugfix to be tested. I don't know if the case of > > ca_src_offset+ca_count beyond EOF behaves the same?) --> The RFC > > seems to require a reply of NFS4ERR_INVAL for this case. > > I've never understood that INVAL requirement. But I know it's > been discussed before, maybe there was some justification for it > that I've forgotten. > > Sigh, well, I don’t know if we should consider adding the check to the > NFS server to be NFS spec compliant. VFS layer didn't want the check > and instead the preference has been to keep read() semantics of > returning a short read (when the len was beyond the end of the file or > if the source) to something beyond the end of the file. I'm inclined to think the spec's just wrong. And how else could a client possibly interpret a 0 return? > On the client if VFS did read of len=0 then VFS itself we return 0, > thus this doesn't protect against other clients sending an NFS copy > with len=0. And in NFS, receiving copy with len=0 means copy to the > end of the file. It's not implemented for any "intra" or "inter" code. A call with len=0 sounds like a different case. --b.