public inbox for gfs2@lists.linux.dev
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
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: Sun, 11 Aug 2024 01:40:37 -0700	[thread overview]
Message-ID: <Zrh5BS3I1yuOHXuY@infradead.org> (raw)
In-Reply-To: <89eb3a19d19c9b4bc19b6edbc708a8a33a911516.1723228772.git.josef@toxicpanda.com>

On Fri, Aug 09, 2024 at 02:44:24PM -0400, Josef Bacik wrote:
> -	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);

This now loses the return value from xfs_write_fault and falls through
to actually do the read fault as well.  I somehow doubt this can work
at all as-is.

Please also move the filemap_maybe_emit_fsnotify_event call into
xfs_write_fault to keep the write fault handling isolated there,
which is the reason that it exists.


      parent reply	other threads:[~2024-08-11  8:40 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
2024-08-11  8:40   ` Christoph Hellwig [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=Zrh5BS3I1yuOHXuY@infradead.org \
    --to=hch@infradead.org \
    --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