From: <gregkh@linuxfoundation.org>
To: libaokun1@huawei.com, jack@suse.cz, tytso@mit.edu
Cc: <stable@vger.kernel.org>
Subject: FAILED: patch "[PATCH] ext4: check iomap type only if ext4_iomap_begin() does not" failed to apply to 5.4-stable tree
Date: Mon, 15 May 2023 06:13:19 +0200 [thread overview]
Message-ID: <2023051519-quarters-shrank-0a63@gregkh> (raw)
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x fa83c34e3e56b3c672af38059e066242655271b1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2023051519-quarters-shrank-0a63@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
fa83c34e3e56 ("ext4: check iomap type only if ext4_iomap_begin() does not fail")
8cd115bdda17 ("ext4: Optimize ext4 DIO overwrites")
aa9714d0e397 ("ext4: Start with shared i_rwsem in case of DIO instead of exclusive")
378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
0b9f230b94dd ("ext4: move inode extension check out from ext4_iomap_alloc()")
569342dc2485 ("ext4: move inode extension/truncate code out from ->iomap_end() callback")
b1b4705d54ab ("ext4: introduce direct I/O read using iomap infrastructure")
09edf4d38195 ("ext4: introduce new callback for IOMAP_REPORT")
f063db5ee989 ("ext4: split IOMAP_WRITE branch in ext4_iomap_begin() into helper")
c8fdfe294187 ("ext4: move set iomap routines into a separate helper ext4_set_iomap()")
2e9b51d78229 ("ext4: iomap that extends beyond EOF should be marked dirty")
548feebec7e9 ("ext4: update direct I/O read lock pattern for IOCB_NOWAIT")
53e5cca56795 ("ext4: reorder map.m_flags checks within ext4_iomap_begin()")
c8cc88163f40 ("ext4: Add support for blocksize < pagesize in dioread_nolock")
2943fdbc688e ("ext4: Refactor mpage_map_and_submit_buffers function")
a00713ea982b ("ext4: Add API to bring in support for unwritten io_end_vec conversion")
821ff38d192a ("ext4: keep uniform naming convention for io & io_end variables")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fa83c34e3e56b3c672af38059e066242655271b1 Mon Sep 17 00:00:00 2001
From: Baokun Li <libaokun1@huawei.com>
Date: Fri, 5 May 2023 21:24:29 +0800
Subject: [PATCH] ext4: check iomap type only if ext4_iomap_begin() does not
fail
When ext4_iomap_overwrite_begin() calls ext4_iomap_begin() map blocks may
fail for some reason (e.g. memory allocation failure, bare disk write), and
later because "iomap->type ! = IOMAP_MAPPED" triggers WARN_ON(). When ext4
iomap_begin() returns an error, it is normal that the type of iomap->type
may not match the expectation. Therefore, we only determine if iomap->type
is as expected when ext4_iomap_begin() is executed successfully.
Cc: stable@kernel.org
Reported-by: syzbot+08106c4b7d60702dbc14@syzkaller.appspotmail.com
Link: https://lore.kernel.org/all/00000000000015760b05f9b4eee9@google.com
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230505132429.714648-1-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3cb774d9e3f1..ce5f21b6c2b3 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3377,7 +3377,7 @@ static int ext4_iomap_overwrite_begin(struct inode *inode, loff_t offset,
*/
flags &= ~IOMAP_WRITE;
ret = ext4_iomap_begin(inode, offset, length, flags, iomap, srcmap);
- WARN_ON_ONCE(iomap->type != IOMAP_MAPPED);
+ WARN_ON_ONCE(!ret && iomap->type != IOMAP_MAPPED);
return ret;
}
reply other threads:[~2023-05-15 4:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=2023051519-quarters-shrank-0a63@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=libaokun1@huawei.com \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
/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