From: Dave Chinner <david@fromorbit.com>
To: Josef Bacik <josef@toxicpanda.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 v3 16/16] xfs: add pre-content fsnotify hook for write faults
Date: Sat, 10 Aug 2024 09:06:26 +1000 [thread overview]
Message-ID: <Zrag8qezssak5rVY@dread.disaster.area> (raw)
In-Reply-To: <89eb3a19d19c9b4bc19b6edbc708a8a33a911516.1723228772.git.josef@toxicpanda.com>
On Fri, Aug 09, 2024 at 02:44:24PM -0400, Josef Bacik wrote:
> xfs has it's own handling for write faults, so we need to add the
> pre-content fsnotify hook for this case. Reads go through filemap_fault
> so they're handled properly there.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> fs/xfs/xfs_file.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 4cdc54dc9686..a00436dd29d1 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1328,8 +1328,13 @@ __xfs_filemap_fault(
>
> trace_xfs_filemap_fault(XFS_I(inode), order, write_fault);
>
> - if (write_fault)
> - return xfs_write_fault(vmf, order);
> + if (write_fault) {
> + vm_fault_t ret = filemap_maybe_emit_fsnotify_event(vmf);
> + if (unlikely(ret))
> + return ret;
> + xfs_write_fault(vmf, order);
> + }
> +
> if (IS_DAX(inode))
> return xfs_dax_read_fault(vmf, order);
> return filemap_fault(vmf);
Looks good now.
Acked-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-08-09 23:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 18:44 [PATCH v3 00/16] fanotify: add pre-content hooks Josef Bacik
2024-08-09 18:44 ` [PATCH v3 01/16] fanotify: don't skip extra event info if no info_mode is set Josef Bacik
2024-08-09 18:44 ` [PATCH v3 02/16] fsnotify: introduce pre-content permission event Josef Bacik
2024-08-09 18:44 ` [PATCH v3 03/16] fsnotify: generate pre-content permission event on open Josef Bacik
2024-08-09 18:44 ` [PATCH v3 04/16] fanotify: introduce FAN_PRE_ACCESS permission event Josef Bacik
2024-08-09 18:44 ` [PATCH v3 05/16] fanotify: introduce FAN_PRE_MODIFY " Josef Bacik
2024-08-09 18:44 ` [PATCH v3 06/16] fanotify: pass optional file access range in pre-content event Josef Bacik
2024-08-09 18:44 ` [PATCH v3 07/16] fanotify: rename a misnamed constant Josef Bacik
2024-08-09 18:44 ` [PATCH v3 08/16] fanotify: report file range info with pre-content events Josef Bacik
2024-08-09 18:44 ` [PATCH v3 09/16] fanotify: allow to set errno in FAN_DENY permission response Josef Bacik
2024-08-09 18:44 ` [PATCH v3 10/16] fanotify: add a helper to check for pre content events Josef Bacik
2024-08-09 18:44 ` [PATCH v3 11/16] fanotify: disable readahead if we have pre-content watches Josef Bacik
2024-08-09 18:44 ` [PATCH v3 12/16] mm: don't allow huge faults for files with pre content watches Josef Bacik
2024-08-09 18:44 ` [PATCH v3 13/16] fsnotify: generate pre-content permission event on page fault Josef Bacik
2024-08-09 23:05 ` Dave Chinner
2024-08-09 18:44 ` [PATCH v3 14/16] bcachefs: add pre-content fsnotify hook to fault Josef Bacik
2024-08-10 20:06 ` Kent Overstreet
2024-08-09 18:44 ` [PATCH v3 15/16] gfs2: " Josef Bacik
2024-08-09 18:44 ` [PATCH v3 16/16] xfs: add pre-content fsnotify hook for write faults Josef Bacik
2024-08-09 23:06 ` Dave Chinner [this message]
2024-08-11 8:40 ` Christoph Hellwig
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=Zrag8qezssak5rVY@dread.disaster.area \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--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