From: Josef Bacik <josef@toxicpanda.com>
To: Dave Chinner <david@fromorbit.com>
Cc: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz,
amir73il@gmail.com, brauner@kernel.org,
linux-xfs@vger.kernel.org, gfs2@lists.linux.dev,
linux-bcachefs@vger.kernel.org
Subject: Re: [PATCH v2 00/16] fanotify: add pre-content hooks
Date: Fri, 9 Aug 2024 10:18:32 -0400 [thread overview]
Message-ID: <20240809141832.GC645452@perftesting> (raw)
In-Reply-To: <ZrVDm+Tjuv6tWlY3@dread.disaster.area>
On Fri, Aug 09, 2024 at 08:15:55AM +1000, Dave Chinner wrote:
> On Thu, Aug 08, 2024 at 03:27:02PM -0400, Josef Bacik wrote:
> > v1: https://lore.kernel.org/linux-fsdevel/cover.1721931241.git.josef@toxicpanda.com/
> >
> > v1->v2:
> > - reworked the page fault logic based on Jan's suggestion and turned it into a
> > helper.
> > - Added 3 patches per-fs where we need to call the fsnotify helper from their
> > ->fault handlers.
> > - Disabled readahead in the case that there's a pre-content watch in place.
> > - Disabled huge faults when there's a pre-content watch in place (entirely
> > because it's untested, theoretically it should be straightforward to do).
> > - Updated the command numbers.
> > - Addressed the random spelling/grammer mistakes that Jan pointed out.
> > - Addressed the other random nits from Jan.
> >
> > --- Original email ---
> >
> > Hello,
> >
> > These are the patches for the bare bones pre-content fanotify support. The
> > majority of this work is Amir's, my contribution to this has solely been around
> > adding the page fault hooks, testing and validating everything. I'm sending it
> > because Amir is traveling a bunch, and I touched it last so I'm going to take
> > all the hate and he can take all the credit.
>
> Brave man. :)
>
> > There is a PoC that I've been using to validate this work, you can find the git
> > repo here
> >
> > https://github.com/josefbacik/remote-fetch
> >
> > This consists of 3 different tools.
> >
> > 1. populate. This just creates all the stub files in the directory from the
> > source directory. Just run ./populate ~/linux ~/hsm-linux and it'll
> > recursively create all of the stub files and directories.
> > 2. remote-fetch. This is the actual PoC, you just point it at the source and
> > destination directory and then you can do whatever. ./remote-fetch ~/linux
> > ~/hsm-linux.
> > 3. mmap-validate. This was to validate the pagefault thing, this is likely what
> > will be turned into the selftest with remote-fetch. It creates a file and
> > then you can validate the file matches the right pattern with both normal
> > reads and mmap. Normally I do something like
> >
> > ./mmap-validate create ~/src/foo
> > ./populate ~/src ~/dst
> > ./rmeote-fetch ~/src ~/dst
> > ./mmap-validate validate ~/dst/foo
>
> This smells like something that should be added to fstests.
>
> FWIW, fstests used to have a whole "fake-hsm" infrastructure
> subsystem in it for testing DMAPI events used by HSMs. They were
> removed in this commit:
>
> commit 6497ede7ad4e9fc8e5a5a121bd600df896b7d9c6
> Author: Darrick J. Wong <djwong@kernel.org>
> Date: Thu Feb 11 13:33:38 2021 -0800
>
> fstests: remove DMAPI tests
>
> Upstream XFS has never supported DMAPI, so remove the tests for this
> feature.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Acked-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
>
> See ./dmapi/src/sample_hsm/ for the HSM test code that was removed
> in that patchset - it might provide some infrastructure that can be
> used to test the fanotify HSM event infrastructure without
> reinventing the entire wheel...
Yup as soon as this is merged into a tree my first stop is LTP, which is where
all the fanotify tests currently exist. It won't cost me anything to add it to
fstests as well, so I'll follow up with that.
Generally I'd post the tests at the same time, but since it's dependent on what
we settle on for the implementation behavior I'm holding that stuff back.
Thanks,
Josef
prev parent reply other threads:[~2024-08-09 14:18 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 19:27 [PATCH v2 00/16] fanotify: add pre-content hooks Josef Bacik
2024-08-08 19:27 ` [PATCH v2 01/16] fanotify: don't skip extra event info if no info_mode is set Josef Bacik
2024-08-08 19:27 ` [PATCH v2 02/16] fsnotify: introduce pre-content permission event Josef Bacik
2024-08-08 19:27 ` [PATCH v2 03/16] fsnotify: generate pre-content permission event on open Josef Bacik
2024-08-09 11:51 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 04/16] fanotify: introduce FAN_PRE_ACCESS permission event Josef Bacik
2024-08-09 11:57 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 05/16] fanotify: introduce FAN_PRE_MODIFY " Josef Bacik
2024-08-09 11:57 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 06/16] fanotify: pass optional file access range in pre-content event Josef Bacik
2024-08-09 12:00 ` Christian Brauner
2024-08-09 18:36 ` Josef Bacik
2024-08-08 19:27 ` [PATCH v2 07/16] fanotify: rename a misnamed constant Josef Bacik
2024-08-09 11:41 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 08/16] fanotify: report file range info with pre-content events Josef Bacik
2024-08-08 19:27 ` [PATCH v2 09/16] fanotify: allow to set errno in FAN_DENY permission response Josef Bacik
2024-08-09 12:06 ` Christian Brauner
2024-08-09 18:38 ` Josef Bacik
2024-08-08 19:27 ` [PATCH v2 10/16] fanotify: add a helper to check for pre content events Josef Bacik
2024-08-09 12:10 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 11/16] fanotify: disable readahead if we have pre-content watches Josef Bacik
2024-08-09 12:12 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 12/16] mm: don't allow huge faults for files with pre content watches Josef Bacik
2024-08-09 12:13 ` Christian Brauner
2024-08-08 19:27 ` [PATCH v2 13/16] fsnotify: generate pre-content permission event on page fault Josef Bacik
2024-08-09 10:34 ` Amir Goldstein
2024-08-09 14:19 ` Josef Bacik
2024-08-08 19:27 ` [PATCH v2 14/16] bcachefs: add pre-content fsnotify hook to fault Josef Bacik
2024-08-09 13:11 ` Amir Goldstein
2024-08-09 14:21 ` Josef Bacik
2024-08-08 19:27 ` [PATCH v2 15/16] gfs2: " Josef Bacik
2024-08-08 19:27 ` [PATCH v2 16/16] xfs: add pre-content fsnotify hook for write faults Josef Bacik
2024-08-08 22:03 ` Dave Chinner
2024-08-09 14:15 ` Josef Bacik
2024-08-08 22:15 ` [PATCH v2 00/16] fanotify: add pre-content hooks Dave Chinner
2024-08-09 14:18 ` Josef Bacik [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=20240809141832.GC645452@perftesting \
--to=josef@toxicpanda.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=david@fromorbit.com \
--cc=gfs2@lists.linux.dev \
--cc=jack@suse.cz \
--cc=kernel-team@fb.com \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@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).