From: Amol Dixit <amoldd@gmail.com>
To: linux-fsdevel@vger.kernel.org
Subject: inotify on mmap writes
Date: Tue, 21 Mar 2023 18:50:14 -0700 [thread overview]
Message-ID: <CADNhMOuFyDv5addXDX3feKGS9edJ3nwBTBh7AB1UY+CYzrreFw@mail.gmail.com> (raw)
Hello,
Apologies if this has been discussed or clarified in the past.
The lack of file modification notification events (inotify, fanotify)
for mmap() regions is a big hole to anybody watching file changes from
userspace. I can imagine atleast 2 reasons why that support may be
lacking, perhaps there are more:
1. mmap() writeback is async (unless msync/fsync triggered) driven by
file IO and page cache writeback mechanims, unlike write system calls
that get funneled via the vfs layer, whih is a convenient common place
to issue notifications. Now mm code would have to find a common ground
with filesystem/vfs, which is messy.
2. writepages, being an address-space op is treated by each file
system independently. If mm did not want to get involved, onus would
be on each filesystem to make their .writepages handlers notification
aware. This is probably also considered not worth the trouble.
So my question is, notwithstanding minor hurdles (like lost events,
hardlinks etc.), would the community like to extend inotify support
for mmap'ed writes to files? Under configs options, would a fix on a
per filesystem basis be an acceptable solution (I can start with say
ext4 writepages linking back to inode/dentry and firing a
notification)?
Eventually we will have larger support across the board and
inotify/fanotify can be a reliable tracking mechanism for
modifications to files.
Thank you,
Amol
next reply other threads:[~2023-03-22 1:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 1:50 Amol Dixit [this message]
2023-03-22 7:15 ` inotify on mmap writes Amir Goldstein
2023-03-22 19:43 ` Amol Dixit
2023-03-22 21:12 ` Amir Goldstein
2023-03-22 22:13 ` Amol Dixit
2023-03-23 6:35 ` Amir Goldstein
2023-03-22 14:50 ` Matthew Wilcox
2023-03-22 19:13 ` Amol Dixit
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=CADNhMOuFyDv5addXDX3feKGS9edJ3nwBTBh7AB1UY+CYzrreFw@mail.gmail.com \
--to=amoldd@gmail.com \
--cc=linux-fsdevel@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).