Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4418680ybb; Tue, 14 Apr 2020 07:00:20 -0700 (PDT) X-Google-Smtp-Source: APiQypIvWlIGcb/Whs7BX54U/4OIyVvecW/59tdGGJLyq41cc7/D1MKoWT+FH3ctLGKCkZZv7ITO X-Received: by 2002:aa7:d906:: with SMTP id a6mr19358160edr.75.1586872820139; Tue, 14 Apr 2020 07:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586872820; cv=none; d=google.com; s=arc-20160816; b=r6ylYus46Di/JduHZN8YAXERNJvHUvLgz8JTpJrzVfUE2Ua1upYxFepdNFs1jMW+Ym sBNIrquxzb3ElJQCHJeg/nVeGbYcsAXNl/nhaxOErXXcehzsTOCamzDWcyvHBG7eGNWs DJWoHLUyYTNLdUPdrJDuSNrEuK5q9vuvmQUsv6CK4Mv5sy63EktnJMt2C+5jm85OfqxN 0kFXMDUm/DNK0RLBA0IIPmM5LzNt9wY4Iw4be0v/NQFXhnxduDly6IZcvdLSV2UtbYPG kB3IPvzoLWkiG8Bl0aOlKFk9Dp/XnBSuhmtaiZH5udJLK1dsGy0PiMMDmaaMcMvIgayZ B/Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NeqKXLYrWUpD8jNTcGC4+w/0QPeCB7it9q+iuJn3+6A=; b=v29laNlz++lPqKUlrfqURASifxIjUWDZwwuWAIiP1i/OU4vm/6X0DKg6XCDjj6G4LF ToOdNPI20/gdtbTwN7e6nT/4XF1O4c9UB8x1YWWxgmgdVcQ+2GKkn9wnhHX0XRIT1DaQ f1PoL3kBaYA3g3VUTTYv7WkoC/BFKC0xctbFLeDyjRkg+tXFFcrt/kA51smqZhmRwst8 5Z+UHNzGAU/zdKSIWgU33n+UdENNyHmBE1RAsZTf6H93U0NcBmBnCQkQGcSeFQ6fzuWC AkmFESRb/p1vzAUBNTPVFUmFuWGh/MFgqL2yQ651MZ5Us1mC6zzQcWujVIkfxYERQ1rE 9l/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="PFv2e/MW"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by8si4258070ejb.525.2020.04.14.06.59.49; Tue, 14 Apr 2020 07:00:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=@gmail.com header.s=20161025 header.b="PFv2e/MW"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404349AbgDNDAa (ORCPT + 99 others); Mon, 13 Apr 2020 23:00:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2404224AbgDNDAa (ORCPT ); Mon, 13 Apr 2020 23:00:30 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3EA0C0A3BDC; Mon, 13 Apr 2020 20:00:29 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id f82so7217850ilh.8; Mon, 13 Apr 2020 20:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NeqKXLYrWUpD8jNTcGC4+w/0QPeCB7it9q+iuJn3+6A=; b=PFv2e/MWAiprnN1BhiBDycrqJD137NITfKgcM7yyJdOWGGyV+BAY02xot6sVwbHfU+ uEptpiXO+doA8o30kbNcrmXTY7DmbhUtqjkyGQvFPMGlRMzVxd7tnHfoBetxg4uq/0Vw BmRav/H54feN1KZotQw7H6sgqxeWFmzHa/5DgwsiS05E6rcS52FCF8fGHL290i5nf5M3 U8imVjIi/3FUdqzyBELP7Dlg06lKzJtiiWkcFt09N+wzhCSOwLoGA5sAdqMXJAxAZ9NL rOri6Y6EQ0ZBpdrucsic1PNOat0LDsc7bgp/tkYl7E9aEXu6GbyM0Im6zpwd6DJKH+dD PT1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NeqKXLYrWUpD8jNTcGC4+w/0QPeCB7it9q+iuJn3+6A=; b=eDNIZUAPHiYKE0RMfKO3Ud7dY6cgfNcquZSRJKuw843xXgRh2+cVOX4u9HXq0YvIt4 /5aDZpXPCoG+TG3BIAUaOqS10oXStqbWSF3UIxN6SsDXHPKtktD70+6X9AhjqqLvI0TH 6Nj4eKP95nsFtp5RiMkcyCd116eHf+71DWK7oIt9J4A2HRjBckZK/ZEOzFalxwpeNmBr lPqG+4up+fP/613XtpAvrzyojB2fsr7QTiJ6MtDgmj+ybXcXa5vqRqtS3QDgby+y4rdP dxXafcRosJRaAH/rXYtOGTnDV3Po+ULzKAz03tpNbjFda0zwQJ+xMn7EtwksGlpO/s6K dRhw== X-Gm-Message-State: AGi0PuYJ1QG01blnApoVL1QNvC4YZalSEEvnyPrJFPH8QxZXvR+qnc3l VTw6In2TKWgT5Woq5w5U/TMXG2WOm+UJiF5jhkXR45Cd X-Received: by 2002:a92:394d:: with SMTP id g74mr19906784ila.250.1586833229197; Mon, 13 Apr 2020 20:00:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amir Goldstein Date: Tue, 14 Apr 2020 06:00:17 +0300 Message-ID: Subject: Re: Same mountpoint restriction in FICLONE ioctls To: Keno Fischer Cc: linux-fsdevel , Miklos Szeredi , linux-xfs , CIFS , Linux NFS Mailing List , Olga Kornievskaia , Steve French Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Apr 13, 2020 at 10:40 PM Keno Fischer wrote: > > > You make it sound like the heuristic decision must be made > > *after* trying to clone, but it can be made before and pass > > flags to the kernel whether or to fallback to copy. > > True, though I simplified slightly. There's other things we try > first if the clone fails, like creating a hardlink. If cloning fails, > we also often only want to copy a part of the file (again > heuristically, whether more than what the program asked > for will be useful for debugging) Fair enough. > > > copy_file_range(2) has an unused flags argument. > > Adding support for flags like: > > COPY_FILE_RANGE_BY_FS > > COPY_FILE_RANGE_BY_KERNEL > > That would solve it of course, and I'd be happy with that > solution, but it seems like we'd end up with just another > spelling for the cloning ioctls then that have subtly different > semantics. > Yeh. Another spelling is a common way to change behavior. In fact, it is the only way if you want to avoid changing behavior of existing application. Generally speaking, syscall interface is an improvement over ioctl interface. Flags like: COPY_FILE_RANGE_REFLINK COPY_FILE_RANGE_NO_XDEV along with proper documentation, can help make the change of behavior explicit. The flags mentioned above would describe the existing FICLONERANGE semantics. But the thing is that the above is not just a fancy maneuver for relaxing the same mnt restriction of FICLONERANGE. I believe that enhancing the semantics of copy_file_range(2) has benefits beyond your use case. copy tools could make use of nfs/cifs server side copy without falling back to kernel copy. Thanks, Amir.