From 708756ee20ea50478f80cef6e49ea858c5ef5e64 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 24 Nov 2023 19:51:38 +0100 Subject: [PATCH] iomap: don't merge ioends with mismatching fs private flag If the file system set it's private flag on one ioend but not the other we better don't merge the two. Signed-off-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index b4e309aa1043..160c184cf860 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1620,8 +1620,8 @@ iomap_ioend_can_merge(struct iomap_ioend *ioend, struct iomap_ioend *next) return false; if (next->io_flags & IOMAP_F_BOUNDARY) return false; - if ((ioend->io_flags & IOMAP_F_SHARED) ^ - (next->io_flags & IOMAP_F_SHARED)) + if ((ioend->io_flags & (IOMAP_F_SHARED | IOMAP_F_PRIVATE)) != + (next->io_flags & (IOMAP_F_SHARED | IOMAP_F_PRIVATE))) return false; if ((ioend->io_type == IOMAP_UNWRITTEN) ^ (next->io_type == IOMAP_UNWRITTEN)) -- 2.50.1