Re: [PATCH] vf/remap: return the amount of bytes actually deduplicated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 13, 2022 at 5:22 PM Dave Chinner <david@xxxxxxxxxxxxx> wrote:
>
> e.g. If userspace is looping over a file based on the returned
> info->bytes_deduped value, can this change cause them to behave
> differently? e.g. get stuck in an endless loop on the EOF block
> always returning SAME/0 instead of DIFFER?

I don't think that case can actually happen.

There's a couple of cases where the length is updated

 (a) an initial zero length request is turned into "size of file".

Here,we'd obviously want to return that size. Plus the original len
was 0 anyway, so it already used that 0 before. Ugh.

 (b) an EOF situation with REMAP_FILE_CAN_SHORTEN does that

                *len = new_len;

but afaik "new_len" can never be zero (because if it was, that would
have been blk-aligned to begin with, and not have reached that code)

But you are right, the whole "SAME/0" return is all kinds of crazy,
and maybe that code should make explicitly sure it can never happen by
just saying "a zero-sized compare can never dedupe successfully" or
something like that. Just in case.

But returning the original length, even when you didn't actually
dedupe it also seems entirely pointless.

            Linus



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux