Re: [nfsv4] Server-side copy question

Thomas Haynes <loghyr@primarydata.com> Thu, 16 February 2017 18:17 UTC

Return-Path: <loghyr@primarydata.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 94D4812955D for <nfsv4@ietfa.amsl.com>; Thu, 16 Feb 2017 10:17:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.51
X-Spam-Level:
X-Spam-Status: No, score=-2.51 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_DKIM_INVALID=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=primarydata.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yJvUbpENx1j8 for <nfsv4@ietfa.amsl.com>; Thu, 16 Feb 2017 10:17:39 -0800 (PST)
Received: from us-smtp-delivery-194.mimecast.com (us-smtp-delivery-194.mimecast.com [63.128.21.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3182B1294F5 for <nfsv4@ietf.org>; Thu, 16 Feb 2017 10:17:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=PrimaryData.onmicrosoft.com; s=selector1-primarydata-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Py2fAcUxqjFBMudA+rmVJzDYOORVAbQOBlneFdBs3jI=; b=A1JIwv9QP/Y/0Id5rLQVOISevcqqpECTxt70EF8O9u774DafHfQ6cYk4qF+W0UOXiu/6ix0tjOaJD5QvTC33KQIw3UdXWmwrRscEKiJg3E9TUnTDUxWQOFYHeGIHPHDpOvMgOIbrjU6PHvWSjfa14gteM6Es4KiZDNEPu79VK1E=
Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01lp0176.outbound.protection.outlook.com [216.32.181.176]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-138-TpHOXSq2PkOLFPZFJhE5qg-1; Thu, 16 Feb 2017 13:17:35 -0500
Received: from BN6PR11MB1362.namprd11.prod.outlook.com (10.173.32.150) by BN6PR11MB1364.namprd11.prod.outlook.com (10.173.33.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Thu, 16 Feb 2017 18:17:33 +0000
Received: from BN6PR11MB1362.namprd11.prod.outlook.com ([10.173.32.150]) by BN6PR11MB1362.namprd11.prod.outlook.com ([10.173.32.150]) with mapi id 15.01.0888.030; Thu, 16 Feb 2017 18:17:33 +0000
From: Thomas Haynes <loghyr@primarydata.com>
To: Dave Noveck <davenoveck@gmail.com>
Thread-Topic: [nfsv4] Server-side copy question
Thread-Index: AQHSh9mJMdo0XM5LV0SkJ1E945V/h6FrmaEAgABYi4A=
Date: Thu, 16 Feb 2017 18:17:32 +0000
Message-ID: <88524AE1-8A77-488C-ACE2-4BC8F63E4EB9@primarydata.com>
References: <B65A07BE-E379-4507-A9B8-6927DF61A0A5@netapp.com> <CADaq8jdhK2NbJrAa0UHacvBS1w0ucoVpc1LJA3=mxH+_iBfMPQ@mail.gmail.com>
In-Reply-To: <CADaq8jdhK2NbJrAa0UHacvBS1w0ucoVpc1LJA3=mxH+_iBfMPQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [63.157.6.18]
x-ms-office365-filtering-correlation-id: c7f24075-ea85-4827-6e88-08d4569813b7
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR11MB1364;
x-microsoft-exchange-diagnostics: 1; BN6PR11MB1364; 7:SA5ZcaWAvM0k69oKivJ+6PMNUOtEKIpQOWiIEkOpVYkFgP4RMStWcjQKHw9VAlKyOOJusk5heh45NudMXmCv4hOnNCy8MWESxpquYdfzzLhWCNgeFy+YVbeM2b0h2SClEfDilKyi7yFrHqjcCk08aHc2LStNL5zbEClBx1thnXPaSN56lj92kxvl9SZKDaa2VN+fPyAQyOumsawznfOh6oMuYg2IcEOoScHrGELsOnDrAYWuMr/0yJDcX/Bbn7Sme0ACyvfjDpLSZhSXi66pF7fbpFkMGGn7u1QLeqIk7a1Y3YAH69W4B7rg9HWEWjt1IEwKimqMYm3Zzy66WAOaJw==; 20:pF4y3lRg5zTiLd/CtRLZX6wK59xmEmfG7gJiDmw74ow4NrAEv7uBLOliwTMUSDTKJW0Fzth/wD6WTKw5rQziMi4uU4UcPFfEuSAsN/eOioC7WKK33GYudUWL9f0dYdRSXNYPnsrMZxMEvpA3jZgAb/3ZZ9zcrGCO8IgwqzTeoV4=
x-microsoft-antispam-prvs: <BN6PR11MB13645319D2B3A3E0D514656ACE5A0@BN6PR11MB1364.namprd11.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(2016111802025)(20161123555025)(20161123562025)(20161123558025)(20161123560025)(20161123564025)(6072148)(6043046); SRVR:BN6PR11MB1364; BCL:0; PCL:0; RULEID:; SRVR:BN6PR11MB1364;
x-forefront-prvs: 0220D4B98D
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(7916002)(39450400003)(39410400002)(39830400002)(189002)(377454003)(199003)(24454002)(25786008)(4326007)(6506006)(189998001)(606005)(81166006)(54906002)(6436002)(99286003)(6512007)(97736004)(8676002)(3660700001)(6306002)(6116002)(102836003)(3846002)(236005)(53936002)(54896002)(81156014)(101416001)(68736007)(76176999)(3280700002)(8936002)(105586002)(229853002)(53546006)(389900003)(36756003)(50986999)(54356999)(2906002)(106356001)(77096006)(106116001)(33656002)(6486002)(66066001)(7906003)(7736002)(83716003)(6246003)(5660300001)(39060400002)(38730400002)(92566002)(82746002)(2950100002)(6916009)(110136004)(2900100001)(86362001)(122556002)(1411001)(42262002)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR11MB1364; H:BN6PR11MB1362.namprd11.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
MIME-Version: 1.0
X-OriginatorOrg: primarydata.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2017 18:17:32.9837 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 03193ed6-8726-4bb3-a832-18ab0d28adb7
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1364
X-MC-Unique: TpHOXSq2PkOLFPZFJhE5qg-1
Content-Type: multipart/alternative; boundary="_000_88524AE18A77488CACE24BC8F63E4EB9primarydatacom_"
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/g36hpdE1B1hWbPdfIP4jQhvAKYI>
Cc: "nfsv4@ietf.org" <nfsv4@ietf.org>
Subject: Re: [nfsv4] Server-side copy question
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 18:17:41 -0000

On Feb 16, 2017, at 5:00 AM, David Noveck <davenoveck@gmail.com<mailto:davenoveck@gmail.com>> wrote:

> The NFSv4.2 spec (RFC 7862) on section 15.2.3 (COPY description) says the following:

> If the source offset or the source offset plus count is greater than
> the size of the source file, the operation MUST fail with
> NFS4ERR_INVAL.

> I can understand failing with NFS4ERR_INVAL when the source offset is beyond the end of the file,
> but do you think failing with NFS4ERR_INVAL is too strict when the source offset plus the count is beyond the end of the file?

Yes.

> What is the rationalization for failing on this specific instance?

I don't know of any.

> Why not return a short copy instead?

If the question is "why not actually implement a server to return a short copy", you could probably do that and get way with it but it is generally better to follow the spec, even if mistaken, unless something horrendous would occur by following it.

If the question is "why doesn't the spec allow you to return a short copy?", I don't know.  I think this is probably just a mistake that wasn't caught in time.

If the question is "why can't the spec be fixed to allow return of a short copy?", it can, in theory, but it is probably not worth the effort.  You can file an erratta, but since this is asking for a change in behavior, there will be a lot of resistance, especially since the word "MUST" is used.


No, I’d file an errata with the justification that implementations we are trying to be compatible with are not compatible with the existing language.



BTW, the word "MUST" probably shouldn't be there since RFC 2119 says:

Imperatives of the type defined in this memo must be used with care and sparingly. In particular, they MUST only be used where it is actually required for interoperation or to limit behavior which has potential for causing harm (e.g., limiting retransmisssions)

> As of right now, the implementation on the Linux server adheres to the spec but copy_file_range succeeds
> when it is called against the local file system, NFSv4.x or NFSv3.
> For the local file system, NFSv4.x or NFSv3 copy_file_range falls back to regular copy by
> reading from the source file and then writing to the destination file but I do believe the
> syscall should be consistent regardless of the underlying file system.

I agree but think that the most expedient way of addressing this problem is in the Linux client,  It can check against the file size before issuing the COPY request  to prevent an erroneous INVAL error being returned.

On Wed, Feb 15, 2017 at 5:19 PM, Mora, Jorge <Jorge.Mora@netapp.com<mailto:Jorge.Mora@netapp.com>> wrote:
Hello,

The NFSv4.2 spec (RFC 7862) on section 15.2.3 (COPY description) says the following:

If the source offset or the source offset plus count is greater than
the size of the source file, the operation MUST fail with
NFS4ERR_INVAL.

I can understand failing with NFS4ERR_INVAL when the source offset is beyond the end of the file,
but do you think failing with NFS4ERR_INVAL is too strict when the source offset plus the count is beyond the end of the file?
What is the rationalization for failing on this specific instance?
Why not return a short copy instead?

As of right now, the implementation on the Linux server adheres to the spec but copy_file_range succeeds
when it is called against the local file system, NFSv4.x or NFSv3.
For the local file system, NFSv4.x or NFSv3 copy_file_range falls back to regular copy by
reading from the source file and then writing to the destination file but I do believe the
syscall should be consistent regardless of the underlying file system.


--Jorge

_______________________________________________
nfsv4 mailing list
nfsv4@ietf.org<mailto:nfsv4@ietf.org>
https://www.ietf.org/mailman/listinfo/nfsv4


_______________________________________________
nfsv4 mailing list
nfsv4@ietf.org<mailto:nfsv4@ietf.org>
https://www.ietf.org/mailman/listinfo/nfsv4