lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOQ4uxj+YSbywkKC8c6qRW55Ujcwxcjkf9sFg=e8m0xp8JLq9g@mail.gmail.com>
Date:   Fri, 20 May 2022 10:52:01 +0300
From:   Amir Goldstein <amir73il@...il.com>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     He Zhe <zhe.he@...driver.com>, Dave Chinner <dchinner@...hat.com>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Luis Henriques <lhenriques@...e.com>,
        Olga Kornievskaia <kolga@...app.com>,
        Linux NFS Mailing List <linux-nfs@...r.kernel.org>
Subject: Re: warning for EOPNOTSUPP vfs_copy_file_range

On Fri, May 20, 2022 at 7:39 AM Amir Goldstein <amir73il@...il.com> wrote:
>
> On Fri, May 20, 2022 at 6:56 AM Al Viro <viro@...iv.linux.org.uk> wrote:
> >
> > On Thu, May 19, 2022 at 04:53:15PM +0300, Amir Goldstein wrote:
> >
> > > Luis gave up on it, because no maintainer stepped up to take
> > > the patch, but I think that is the right way to go.
> > >
> > > Maybe this bug report can raise awareness to that old patch.
> > >
> > > Al, could you have a look?
> >
> > IIRC, you had objections to that variant back then...
>
> Right. But not about the "main" patch.
> The patch had an "also" part:
>
> The short-circuit code for the case where the copy length is zero has also
> been dropped from the VFS code.  This is because a zero size copy between
> two files shall provide a clear indication on whether or not the
> filesystem supports non-zero copies.
>
> -     if (len == 0)
> -         return 0;
> -
>
> Which would have been a regression for nfs client, because
> nfs protocol treats length 0 from ->copy_file_range() as "copy everything":
>
> https://lore.kernel.org/linux-fsdevel/CAOQ4uxgwcNwWEqYKBg3fMHD3aXOsYUmPeexBe9EVP9Nb53b-Hw@mail.gmail.com/
>
> This api impedance should be fixed in the nfs client, but I'm
> not sure if that was already done.
>
> I will test and re-post Luis' patch without removing the short-circuit
> unless Luis gets to it first.
>

Urgh! That old patch passes the fstests -g copy_range group
on nfs, but fails almost all of them on xfs/btrfs.

The reason is that when we allow to perform copy_range
with remap_file_range() it fails for sizes smaller than block size
and returning short read of 0 from copy_range is not an option.

So what I am going to do is to keep the basic restriction in this patch of:
"copy_range allowed for fs that implement either ->copy_file_range()
or ->remap_file_range() (for same sb copy)"

But will change the logic of:
"try clone and then copy then fail"
to:
- try ->copy_file_range()
- try ->remap_file_range()
- fall back to kernel copy

Patch coming shortly.

Thanks,
Amir.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ