Commit f802b6558eb8 for kernel

commit f802b6558eb81bd5888d761a0cdc8afe5fd8c941
Merge: 62b13f41be62 855abf2cf8cd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Nov 21 15:36:04 2026 -0800

    Merge tag 'xfs-fixes-7.4-rc4' of git://git.kernel.org:/pub/scm/fs/xfs/xfs-linux

    Pull xfs fixes from Carlos Maiolino:
     "Mostly this includes fixes for a few races, an ordering problem during
      init/teardown of proc/sysfs, missing locks, etc"

    * tag 'xfs-fixes-7.4-rc4' of git://git.kernel.org:/pub/scm/fs/xfs/xfs-linux:
      xfs: test for realtime and reflink under the pNFS locks
      xfs: don't enable DAX on zoned inodes
      xfs: restart faults racing with realtime flag changes
      xfs: take the MMAPLOCK in xfs_fileattr_set()
      xfs: refuse fallocate racing with realtime flag changes
      xfs: test for always COW after the dio write checks
      xfs: refuse writes to files racing with realtime inode flag changes
      xfs: test for reflink after the dio write checks
      xfs: properly order xfsstats proc/sysfs init and teardown
      xfs: remove unused variable in xrep_tempfile_copyin()
      xfs: remove unused variable in xchk_stats_estimate_bufsize()
      xfs: fix f_bfree underflow in statfs()
      xfs: wait for direct I/O before swapping extents
      xfs: break layouts before swapping extents
      iomap: don't punch delalloc under a dirty EOF block
      xfs: don't change the block map under a dirty folio
      xfs: flush the shifted range before changing the file
      xfs: don't skip the flush before shifting extents
      xfs: always call xfs_update_stable_writes in xfs_ioctl_setattr_xflags
      xfs: keep successful near rt allocations

diff --cc fs/xfs/xfs_file.c
index d61ea8e2c8e4,8070a07e601f..ad1ce4f99ad8
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@@ -1980,11 -2039,22 +2040,22 @@@ __xfs_write_fault
  		lock_mode = XFS_MMAPLOCK_EXCL;
  	}

- 	if (IS_DAX(inode))
+ 	/*
+ 	 * The caller picked the zoned or the regular path with no lock held.
+ 	 * The realtime flag cannot change under the MMAPLOCK, so look at it
+ 	 * again, and start over if it has changed.
+ 	 */
+ 	if (xfs_is_zoned_inode(ip) != !!ac) {
+ 		xfs_warn_ratelimited(ip->i_mount,
+ 			"RT flag modifying during page fault for inode 0x%llx.",
+ 			inode->i_ino);
+ 		ret = VM_FAULT_NOPAGE;
+ 	} else if (IS_DAX(inode)) {
  		ret = xfs_dax_fault_locked(vmf, order, true);
- 	else
+ 	} else {
 -		ret = iomap_page_mkwrite(vmf, &xfs_buffered_write_iomap_ops,
 +		ret = iomap_page_mkwrite(vmf, xfs_buffered_write_iomap_next,
  				ac);
+ 	}
  	xfs_iunlock(ip, lock_mode);

  	sb_end_pagefault(inode->i_sb);