From: Zhang Yi <yi.zhang@xxxxxxxxxx> commit fc8d0ba0ff5fe4700fa02008b7751ec6b84b7677 upstream. Allow callers to pass a NULLL seq argument if they don't care about the fork sequence number. Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx> Signed-off-by: Chandan Babu R <chandanbabu@xxxxxxxxxx> Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx> Acked-by: Darrick J. Wong <djwong@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/xfs/libxfs/xfs_bmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4595,7 +4595,8 @@ xfs_bmapi_convert_delalloc( if (!isnullstartblock(bma.got.br_startblock)) { xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, xfs_iomap_inode_sequence(ip, flags)); - *seq = READ_ONCE(ifp->if_seq); + if (seq) + *seq = READ_ONCE(ifp->if_seq); goto out_trans_cancel; } @@ -4641,7 +4642,8 @@ xfs_bmapi_convert_delalloc( ASSERT(!isnullstartblock(bma.got.br_startblock)); xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, xfs_iomap_inode_sequence(ip, flags)); - *seq = READ_ONCE(ifp->if_seq); + if (seq) + *seq = READ_ONCE(ifp->if_seq); if (whichfork == XFS_COW_FORK) xfs_refcount_alloc_cow_extent(tp, bma.blkno, bma.length); Patches currently in stable-queue which might be from catherine.hoang@xxxxxxxxxx are queue-6.6/xfs-enforce-one-namespace-per-attribute.patch queue-6.6/xfs-use-dontcache-for-grabbing-inodes-during-scrub.patch queue-6.6/xfs-revert-commit-44af6c7e59b12.patch queue-6.6/xfs-check-shortform-attr-entry-flags-specifically.patch queue-6.6/xfs-make-the-seq-argument-to-xfs_bmapi_convert_delalloc-optional.patch queue-6.6/xfs-check-opcode-and-iovec-count-match-in-xlog_recover_attri_commit_pass2.patch queue-6.6/xfs-allow-symlinks-with-short-remote-targets.patch queue-6.6/xfs-match-lock-mode-in-xfs_buffered_write_iomap_begin.patch queue-6.6/xfs-require-xfs_sb_feat_incompat_log_xattrs-for-attr-log-intent-item-recovery.patch queue-6.6/xfs-allow-unlinked-symlinks-and-dirs-with-zero-size.patch queue-6.6/xfs-restrict-when-we-try-to-align-cow-fork-delalloc-to-cowextsz-hints.patch queue-6.6/xfs-fix-xfs_bmap_add_extent_delay_real-for-partial-conversions.patch queue-6.6/xfs-fix-missing-check-for-invalid-attr-flags.patch queue-6.6/xfs-validate-recovered-name-buffers-when-recovering-xattr-items.patch queue-6.6/xfs-make-xfs_bmapi_convert_delalloc-to-allocate-the-target-offset.patch queue-6.6/xfs-convert-delayed-extents-to-unwritten-when-zeroing-post-eof-blocks.patch queue-6.6/xfs-fix-freeing-speculative-preallocations-for-preallocated-files.patch queue-6.6/xfs-fix-unlink-vs-cluster-buffer-instantiation-race.patch queue-6.6/xfs-make-sure-sb_fdblocks-is-non-negative.patch queue-6.6/xfs-remove-a-racy-if_bytes-check-in-xfs_reflink_end_cow_extent.patch queue-6.6/xfs-fix-error-returns-from-xfs_bmapi_write.patch