Re: [syzbot] [iomap?] [xfs?] WARNING in iomap_write_begin

From: Julian Sun
Date: Fri Aug 30 2024 - 07:31:57 EST


The patch passed test locally, and the patch in the link
appears to be messed up. Please retest.

#syz test: upstream ee9a43b7cfe2

diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 72c981e3dc92..6216c31aa3cc 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1162,6 +1162,9 @@ xfs_buffered_write_iomap_begin(
if (error)
goto out_unlock;

+ /* Get extent info that may updated by xfs_bmapi_reserve_delalloc() */
+ xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap);
+
/*
* Flag newly allocated delalloc blocks with IOMAP_F_NEW so we punch
* them out if the write happens to fail.