Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: hch@lst.de, cem@kernel.org, stable@vger.kernel.org,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/6] xfs: don't modify file attributes or poke fsnotify for dry runs
Date: Wed, 19 Aug 2026 16:24:45 -0700	[thread overview]
Message-ID: <20260819232445.GE6072@frogsfrogsfrogs> (raw)
In-Reply-To: <aoVMFaHJoBl-xYAb@infradead.org>

On Tue, Aug 18, 2026 at 11:24:21PM -0700, Christoph Hellwig wrote:
> On Wed, Aug 12, 2026 at 10:26:43PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > LOLLM points out that a dry run shouldn't poke fsnotify because we don't
> > actually change the files.  I noticed that we also shouldn't be removing
> > file privileges when doing a dry run.
> 
> > +++ b/fs/xfs/xfs_exchrange.c
> > @@ -701,6 +701,9 @@ xfs_exchrange_contents(
> >  	if (error)
> >  		goto out_unlock;
> >  
> > +	if (fxr->flags & XFS_EXCHANGE_RANGE_DRY_RUN)
> > +		goto out_unlock;
> > +
> >  	/*
> >  	 * Finish the exchange by removing special file privileges like any
> >  	 * other file write would do.  This may involve turning on support for
> 
> This just skip removing the privileges.  I guess the commit mentions
> this on the side, but this is probably the important part, so my
> emphasis it?  It would also seem easier to move the check into
> xfs_exchange_range_finish next to the code that it guards.

Yeah, I'll move it, and rearrange the commit message.

> > @@ -783,6 +786,9 @@ xfs_exchange_range(
> >  	if (ret)
> >  		return ret;
> >  
> > +	if (fxr->flags & XFS_EXCHANGE_RANGE_DRY_RUN)
> > +		return 0;
> > +
> >  	fsnotify_modify(fxr->file1);
> >  	if (fxr->file2 != fxr->file1)
> >  		fsnotify_modify(fxr->file2);
> 
> Move the fsnotify calls into an if statement instead of the
> early return?

Done.

--D

  reply	other threads:[~2026-08-19 23:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  5:24 [PATCHSET 2/2] xfs: LLM-inspired bug fixes, part 6 Darrick J. Wong
2026-08-13  5:25 ` [PATCH 1/6] xfs: fix xfs_rtrmapbt_mem_cursor for non-rmap filesystems Darrick J. Wong
2026-08-19  6:16   ` Christoph Hellwig
2026-08-19 23:19     ` Darrick J. Wong
2026-08-19 23:30       ` Darrick J. Wong
2026-08-20  5:39         ` Christoph Hellwig
2026-08-20 16:03           ` Darrick J. Wong
2026-08-13  5:25 ` [PATCH 2/6] xfs: preserve owner on in-memory btree creation Darrick J. Wong
2026-08-19  6:17   ` Christoph Hellwig
2026-08-13  5:26 ` [PATCH 3/6] xfs: don't leak new_bp if xfs_btree_bload_drop_buf fails Darrick J. Wong
2026-08-19  6:20   ` Christoph Hellwig
2026-08-13  5:26 ` [PATCH 4/6] xfs: actually recover intended file sizes in xfs_xmi_item_recover_intent Darrick J. Wong
2026-08-19  6:21   ` Christoph Hellwig
2026-08-13  5:26 ` [PATCH 5/6] xfs: don't modify file attributes or poke fsnotify for dry runs Darrick J. Wong
2026-08-19  6:24   ` Christoph Hellwig
2026-08-19 23:24     ` Darrick J. Wong [this message]
2026-08-13  5:26 ` [PATCH 6/6] xfs: fix bnobt repair space reservation disposal failure Darrick J. Wong
2026-08-19  6:24   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2026-09-02  5:41 [PATCHSET v2 2/5] xfs: LLM-inspired bug fixes, part 6 Darrick J. Wong
2026-09-02  5:44 ` [PATCH 5/6] xfs: don't modify file attributes or poke fsnotify for dry runs Darrick J. Wong
2026-09-02  7:13   ` 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=20260819232445.GE6072@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=stable@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