From: Horst Birthelmer <horst@birthelmer.de>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Yichong Chen <chenyichong@uniontech.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Niels de Vos <ndevos@redhat.com>,
fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] fuse: skip destination updates for zero-byte copy
Date: Fri, 24 Jul 2026 13:24:05 +0200 [thread overview]
Message-ID: <amNJuklWlOcoshrq@fedora.fritz.box> (raw)
In-Reply-To: <CAOQ4uxjys+yENYgjROu3Ui-athFjdY0E4fGhR4qsb2ed04wqkw@mail.gmail.com>
On Thu, Jul 23, 2026 at 12:43:29PM +0200, Amir Goldstein wrote:
> On Thu, Jul 23, 2026 at 12:15 PM Yichong Chen <chenyichong@uniontech.com> wrote:
> >
> > __fuse_copy_file_range() may receive a successful copy reply with zero
> > bytes copied. This can happen even though the VFS only calls the file
> > operation with a non-zero length, for example if the FUSE daemon reaches
> > EOF while the kernel has stale source size information.
> >
> > In that case no data was written to the destination. Do not invalidate
> > the destination page cache or update the destination timestamps and cached
> > size state for a zero-byte copy result.
>
> Why not?
> If the FUSE daemon reaches EOF and VFS thinks that there is still something
> to read then obviously the cached size is incorrect.
> Also invalidating the last page cache in this case does not seem like a terrible
> idea in any case.
>
> Are you proposing this "fix" because an application encountered a problem
> or unexpected behavior or why?
I agree with Amir, but I think it is worse.
There is no check in that function for len not to be zero.
So if something calls this with len set to zero, we expect it to either do it
and call all the updates.
Calling the write and react on the result without knowing if this was intended doesn't
look right to me.
Someone might actually call this with len zero.
>
> Thanks,
> Amir.
>
Thanks,
Horst
prev parent reply other threads:[~2026-07-24 11:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 10:07 Yichong Chen
2026-07-23 10:33 ` Niels de Vos
2026-07-23 10:43 ` Amir Goldstein
2026-07-24 10:55 ` Yichong Chen
2026-07-24 11:24 ` Horst Birthelmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amNJuklWlOcoshrq@fedora.fritz.box \
--to=horst@birthelmer.de \
--cc=amir73il@gmail.com \
--cc=chenyichong@uniontech.com \
--cc=fuse-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=ndevos@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®