From: Miklos Szeredi <miklos@szeredi.hu>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Chengguang Xu <cgxu519@mykernel.net>,
overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] ovl: copy-up optimization for truncate
Date: Fri, 9 Apr 2021 10:02:11 +0200 [thread overview]
Message-ID: <CAJfpegu4+eSKkgugicZECKpSOSEuGJudGH-=0aNP5-f3uY9KUw@mail.gmail.com> (raw)
In-Reply-To: <CAOQ4uxhj3F_KQLyxEz3u7L-se-zWj40XiEsUKcuFurvYK_5S0w@mail.gmail.com>
On Fri, Apr 9, 2021 at 7:50 AM Amir Goldstein <amir73il@gmail.com> wrote:
> Anyway, I hold my opinion that the optimization of skipping notify_change()
> has little benefit and is a potential for bugs, even if the specific
> bug I pointed
> out is not real.
I can agree with that.
At this point the only sane way I can see this optimization be
implemented is to split the copy-up into a preparation and a commit
phase:
1) copy to tmpfile (can optimize to truncated size)
2) call notify_change() on the tmpfile to truncate
3) if successful, link the tmpfile into upper
With that the truncate still remains a single atomic operation.
Only slight difference is that now ctime will not match mtime after a
copy-up/truncate operation, but I guess that's not something anybody
should be dependent on.
Thanks,
Miklos
next prev parent reply other threads:[~2021-04-09 8:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 12:02 [PATCH v2 1/3] ovl: do not restore mtime on copy-up for regular file Chengguang Xu
2021-04-06 12:02 ` [PATCH v2 2/3] ovl: check actual copy-up size Chengguang Xu
2021-04-07 6:56 ` Amir Goldstein
2021-04-06 12:02 ` [PATCH v2 3/3] ovl: copy-up optimization for truncate Chengguang Xu
2021-04-07 7:52 ` Amir Goldstein
2021-04-08 13:23 ` Chengguang Xu
2021-04-08 14:40 ` Amir Goldstein
2021-04-09 3:00 ` Chengguang Xu
2021-04-09 5:50 ` Amir Goldstein
2021-04-09 8:02 ` Miklos Szeredi [this message]
2021-04-07 6:55 ` [PATCH v2 1/3] ovl: do not restore mtime on copy-up for regular file Amir Goldstein
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='CAJfpegu4+eSKkgugicZECKpSOSEuGJudGH-=0aNP5-f3uY9KUw@mail.gmail.com' \
--to=miklos@szeredi.hu \
--cc=amir73il@gmail.com \
--cc=cgxu519@mykernel.net \
--cc=linux-unionfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).