Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2374825ybb; Sun, 12 Apr 2020 04:30:24 -0700 (PDT) X-Google-Smtp-Source: APiQypJzJlL7FiZFBuNzRfRqggwI5mZ5Tb4PBgZ4zPyppZGfwrICSP+4rU8KyK4+L+ljS111eDx7 X-Received: by 2002:ac8:7c85:: with SMTP id y5mr6812587qtv.56.1586691023940; Sun, 12 Apr 2020 04:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586691023; cv=none; d=google.com; s=arc-20160816; b=v/3t/UNvl9t88iRPTJAG6uwHyxA0SG30ikZ07gRCK0df6j32fI8ijFcW92+yT7JZwt xsGpoa6imNN2WJHCbuCnx9fU8f7wOxxLjmi3iuXC6zEDgW0x/6M3PwsEYZrIoVxFcpLV wbfQY/VAFvbuQ3IgN9F2nKDBWUOJrCu1tvEqQ8hBhRb77MbD3R3+7PwVVlbtDNXixCuI 0wUO9rLcuoxInwRiAYuENjDfaFqLogzEP7tl6amRNLeCrFa5a9DMF09HwFETrfYmDLYL E6wa3F09z56D3FQDnKbhda9DiHN2hOjRTfH7kMNtr6I3zsFQlsiDtNEzb/RG0wkKkbRO 6qIg== 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=lr8Du1SNizwqButahq7qkxIKOJ2tYQem2z0WmME8mcI=; b=zl9OJ4GCOJWph9nwExi9AtbUtIB6f2Hun1JQ1FbL280fo9wXSfxUeXIRvIz2NkItUn rBBivGFfDb6ELvS0bIipJVegPKk0MVQeyRVdtCYu4r3c4FjebWdCDf7LgL6Hq9V9Q7Rd quJIN8gF8NbZ+WOwOmckz4pgmLcTuA4huJnPD9spyz2tcHrW1u3Q10Qtf0fTp5SrbvSx qR50EoB+hNu3NbPTRBld/S1Z8k6L/uuh6E/KRKTM6m/J0adsqsgiDskUfjpQ+m9Ey7DL eX349VpTr3RaHkQ4plqxnPq2+uX+RqypmC7ZecnzkTlA//TuZQSel4VbBDzqwSL/kZzB bq3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LRxbCfnM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si4371114qkl.95.2020.04.12.04.29.55; Sun, 12 Apr 2020 04:30:23 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LRxbCfnM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726658AbgDLL3r (ORCPT + 99 others); Sun, 12 Apr 2020 07:29:47 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:39075 "EHLO mail-io1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgDLL3q (ORCPT ); Sun, 12 Apr 2020 07:29:46 -0400 Received: by mail-io1-f52.google.com with SMTP id m4so6597107ioq.6; Sun, 12 Apr 2020 04:29:46 -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=lr8Du1SNizwqButahq7qkxIKOJ2tYQem2z0WmME8mcI=; b=LRxbCfnM2pAXUuR19iUj6iP0vBxBl6OyeOmOOFBnYiOUeygcQ6wd1ZJA8timIuABUC qwiyPIxYWoFB0KCfgStqa+sucIENFSFvuxV8jsgBP98rW2uLQoWKjQxVJhKDGBVZ+6xe R7PXQvvSTcHwhvyiqPcN/tjHlnXBVdMgSle2tEim4e0DIJkyK36IJJVTuF4NMB9PnNgy B7JPZMVRJ2EQMuwlhRlQreGJoMd/A9TK4nt09k72toTtnRmCb9qFnVIIux0+PIBx24ng qHmcHmpPCaKYSBeG1F+fEImHYHNyFphV79PbEwuBStrk1+bH4acZopN6z/F0OA7M8hY4 zEZA== 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=lr8Du1SNizwqButahq7qkxIKOJ2tYQem2z0WmME8mcI=; b=DNCrM6CC1K7gz75dwyseFfjfYG0aNrb6lKA6PO9gsCRpO8Eje2Tzy75VHJDRsxbSNS zWqGkP18q4RFbsG+XbJa29s9KYguopuRHk8bhC8P95t9aLEit8HQG/6rE9f/qS+/qZQa xAPKzTsZc3xbb7S1KGlwjn/K1R0pM1+LQZBgU5aM5tHyXnK5EpK2Aeqxr1LUU1hrMO9+ DSluX7McTJcMjULXVeZDcX939IP/K3aCOo1ZOfYZXP00Tnest2cPbEEHxJQ7NHss1X2M dLDcCV/PJLtN6BFziFbNMh9IiVbAxSkiJ4dxdTx48geHuemYYrUek1bHr23wCsYN+iVM hRyg== X-Gm-Message-State: AGi0Pubk4M+aVapQJc/fO1Qik9hs3qL4vXT11L/icNFxAK5lIz5SR7LZ afG1agQYkDrEpnsEftJ6sJKQ/QN8kXLg++4gftE= X-Received: by 2002:a05:6638:38e:: with SMTP id y14mr11426792jap.123.1586690986095; Sun, 12 Apr 2020 04:29:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amir Goldstein Date: Sun, 12 Apr 2020 14:29:35 +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 +CC XFS,NFS,CIFS On Sun, Apr 12, 2020 at 1:06 PM Keno Fischer wrote: > > Hello, > > I was curious about the reasoning behind the > same-mountpoint restriction in the FICLONE > ioctl. I saw that in commit > > [913b86e92] vfs: allow vfs_clone_file_range() across mount points > > this check was moved from the vfs layer into > the ioctl itself, so it appears to be a policy restriction > rather than a technical limitation. I understand why > hardlinks are disallowed across mount point boundaries, > but it seems like that rationale would not apply to clones, > since modifying the clone would not affect the original > file. Is there some other reason that the ioctl enforces > this restriction? > I don't know. I suppose that when FICLONE was introduced there wasn't any use case for cross mount clone. Note that copy_file_range() also had this restriction, which was recently lifted, because NFSv4 and CIFS needed this functionality. As far as I can tell, CIFS and NFSv4 can also support cross mount clone, but nobody stepped up to request or implement that. The question is: do you *really* need cross mount clone? Can you use copy_file_range() instead? It attempts to do remap_file_range() (clone) before falling back to kernel copy_file_range(). > Removing this restrictions would have some performance > advantages for us, but I figured there must be a good reason > why it's there that I just don't know about, so I figured I'd ask. > You did not specify your use case. Across which filesystems mounts are you trying to clone? Thanks, Amir.