Re: [nfsv4] Server-side copy question

Trond Myklebust <trondmy@gmail.com> Sat, 18 February 2017 18:29 UTC

Return-Path: <trondmy@gmail.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 61E4C1293F0 for <nfsv4@ietfa.amsl.com>; Sat, 18 Feb 2017 10:29:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 syQ-WlJ0YIpO for <nfsv4@ietfa.amsl.com>; Sat, 18 Feb 2017 10:29:50 -0800 (PST)
Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1E877128874 for <nfsv4@ietf.org>; Sat, 18 Feb 2017 10:29:50 -0800 (PST)
Received: by mail-io0-x231.google.com with SMTP id g18so9902098ioe.0 for <nfsv4@ietf.org>; Sat, 18 Feb 2017 10:29:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yTcDCfwsMcVQTsrtPl7MIZ1DQJZPPoa8QMTEfVZRVW8=; b=nq5AWQe0L51QXRG3GRW6tO9MuEVxNnmH/dDCRKlPZPtMM4nH7fT2qEtHON7dW5T5xV AoHQgkcDdSeT0T0imFrufXP5HBsd0fachgnMRdOXxBX8AzFglhY+Jyd/XI/LJcs9h91d 0PuH/AxV6+POJ8HsdChGog22nm95YDnyezyjnQBezOeYgbZDw7MW/QHmnOzh4Kslq51s QSCwzno12wBugGPd0Wx/G5sYGrJ8uyAKx/CG5OTuk/IMQQB9sjX0/RvOH13h227/192C np9YuxeVWfQY8gOvk/7q00ZP7qZfc+AdxgTxxT/jsDQvXl9lQtPNltoXdihCJfz3O4st nEIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yTcDCfwsMcVQTsrtPl7MIZ1DQJZPPoa8QMTEfVZRVW8=; b=JseDASd9rRVBjS9WhiuPQzAI3AqohsP6R1XfbI39Ro7zK4hR23XzFerLBU+NS5GiB4 pX6wW9TGArL6i3PEB54m/FUC2GwW9igzwBT5TssmQCo3XjKWsTEIbnYOS9tO06lNk7pB mVim6B+LR6D7tV8b9gKDnXQs5Dthai1s80vshYVU3MZ/aeleFQL81V30zEtYaCEPIoJ2 ltANaDTOSrGByj5QVkXqhw5wkJeNC0HMyXEPMDN0Y3RqRO2EVcpI9zN4k2DEJarQQ70V uJ/JmDRkj9A74FzPCilvip05JOGe4yeNWqIUShOH1z2GIjgqQiNe2jWRW2u0hHTNZ57K X5FA==
X-Gm-Message-State: AMke39kmAC8jMdCTue2kjT6jQ/zt5zwxQjdO6HOcSAXnFFN8qncaPnU0aoeDDkOzIOSIXg==
X-Received: by 10.107.201.12 with SMTP id z12mr11283530iof.220.1487442589453; Sat, 18 Feb 2017 10:29:49 -0800 (PST)
Received: from ladejarl.lan ([50.124.63.84]) by smtp.gmail.com with ESMTPSA id 35sm6777197iot.6.2017.02.18.10.29.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 10:29:48 -0800 (PST)
From: Trond Myklebust <trondmy@gmail.com>
Message-Id: <3889A2C2-9261-4809-92F9-9CF2F00A894D@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_1C11C612-FABB-48E3-9D2B-11466EE28FF6"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Date: Sat, 18 Feb 2017 13:29:47 -0500
In-Reply-To: <CADaq8jc4XRaFSXz7mberFi0Dr-f+FaQcZFi=gKn9OjUifrNSyw@mail.gmail.com>
To: Dave Noveck <davenoveck@gmail.com>
References: <B65A07BE-E379-4507-A9B8-6927DF61A0A5@netapp.com> <CADaq8jdhK2NbJrAa0UHacvBS1w0ucoVpc1LJA3=mxH+_iBfMPQ@mail.gmail.com> <20170217195149.GH10894@fieldses.org> <CADaq8jc4XRaFSXz7mberFi0Dr-f+FaQcZFi=gKn9OjUifrNSyw@mail.gmail.com>
X-Mailer: Apple Mail (2.3259)
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/HkRHmX7lg5VTUM9ABYaUilHfigg>
Cc: Bruce James Fields <bfields@fieldses.org>, IETF NFSv4 WG Mailing List <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: Sat, 18 Feb 2017 18:29:52 -0000

> So here is my proposed corrected text:
> 
> When the source offset is greater than the size of the source file, the error
> 
> is reported by failing the operation with NFS4ERR_INVAL.  Otherwise, If 
> 
> the source offset plus count is greater than the size of the source file, the 
> 
> server MAY fail the operation with NFS4ERR_INVAL.or limit the area to 
> 
> be copied to reflect the size of the source file.
> 

Could we please make that message to implementors stronger, but saying “the server SHOULD limit the are to be copied to reflect the size of the source file, but it MAY fail the operation with NFS4ERR_INVAL”?

Cheers
  Trond



> On Feb 18, 2017, at 07:45, David Noveck <davenoveck@gmail.com> wrote:
> 
> > > 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.
> 
> > That doesn't work, due to races with concurrent modifications to the
> > file.
> 
> I'm not sure whether it works or not.  I can't find an obvious breakage
> but I can't prove that none exists.
> 
> In any case, we can't consider this an easy fix for the issue.
> 
> > The server itself would seem susceptible to such races: if it implements
> > the copy as a read-write loop then blocking concurrent truncates
> > probably isn't reasonable, so its only choice is a short copy.  (Too
> > late to return INVAL once you've written to the destination....).
> 
> That's an implementation problem that would exist no matter 
> what we do to the spec text under discussion.
> 
> > I really think the spec's just wrong here.'
> 
> I agree, as does Tom and Jorge as well I suppose.   Nobody has said it
> was a good choice.
> 
> The question is what to do to fix it.  This is particularly difficult given
> the misuse of "MUST".  The problem I'm worried about is that
> the existing approach is presented as required for interoperability.
> We know of cases where that approach has been followed and
> the problem is that the existing spec essentially says that clients 
> might break if servers do something else. :-(
> 
> We know that isn't true but sombody (Spencer D?) is going to have
> to convince people in the IESG of that.
> 
> So I think the focus of any correction has to be on the fact that the "MUST"
> is wrong rather than on the fact (also true) that the wrong behavior was chosen.
> 
> So here is my proposed corrected text:
> 
> When the source offset is greater than the size of the source file, the error
> 
> is reported by failing the operation with NFS4ERR_INVAL.  Otherwise, If 
> 
> the source offset plus count is greater than the size of the source file, the 
> 
> server MAY fail the operation with NFS4ERR_INVAL.or limit the area to 
> 
> be copied to reflect the size of the source file.
> 
> 
>> 
> 
> 
> 
> On Fri, Feb 17, 2017 at 2:51 PM, J. Bruce Fields <bfields@fieldses.org <mailto:bfields@fieldses.org>> wrote:
> On Thu, Feb 16, 2017 at 08:00:36AM -0500, David Noveck wrote:
> > 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.
> 
> That doesn't work, due to races with concurrent modifications to the
> file.
> 
> The server itself would seem succeptible to such races: if it implements
> the copy as a read-write loop then blocking concurrent truncates
> probably isn't reasonable, so its only choice is a short copy.  (Too
> late to return INVAL once you've written to the destination....).
> 
> I really think the spec's just wrong here.
> 
> --b.
> 
> _______________________________________________
> nfsv4 mailing list
> nfsv4@ietf.org
> https://www.ietf.org/mailman/listinfo/nfsv4