From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72CF421B1BF for ; Tue, 17 Mar 2026 11:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773747388; cv=none; b=lZCnJo4G/gz49JsWvV2AG8CG1v7KrSRuganUhMCNOjhRL+0YX0YrfAEyFUMHo8Lp/UWFOUDjHFt9GYlEagSjXGI3cZVWlSq0epjI7FA8Ca13EF7RN+LCFQ3kQ/ANKBj+eP2ctqoaXJs6bWCj4TfnUxaY7fEDLgewK1yuJG1MZr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773747388; c=relaxed/simple; bh=F44UeqloYKw7aQc+7V0DwzYuylrXLuT7Ku/6115U/QY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ciLI/ci844UA+OmLFrUilOVDNZaerps7P/EVPwJrSQtDao313Ucw4PJEcrZ5OUbNlrfkKOgxYUna9hR5rEeLikrb9XY3FtzDXW/Akx53Xb0yknXDryyPPMKSs1ADNldjqKBDEr04G7aJ7/fQ+IwSv67NB+aw6qZwgKXSupzC1RY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NMdAjW42; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NMdAjW42" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2B71C19425; Tue, 17 Mar 2026 11:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773747388; bh=F44UeqloYKw7aQc+7V0DwzYuylrXLuT7Ku/6115U/QY=; h=Subject:To:Cc:From:Date:From; b=NMdAjW42boqCezg4uDrk1UlqbnEoiB6Gib6RwvxfkpxttVMMzpPhDCCN326ppx/h4 9JhKMWWzw2VRsaRLmK58MocFuQUsn5Zb4nkiFWNbfBmRxQZgvmBT0sj/SzUUZNA26y OiV7T+gYrHTxLG5qOyb4LZS9SlYvUYn16iXFXS+g= Subject: FAILED: patch "[PATCH] iomap: reject delalloc mappings during writeback" failed to apply to 6.1-stable tree To: djwong@kernel.org,brauner@kernel.org,cmaiolino@redhat.com,hch@lst.de Cc: From: Date: Tue, 17 Mar 2026 12:36:13 +0100 Message-ID: <2026031713-ride-olympics-fd2c@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-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 . 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-6.1.y git checkout FETCH_HEAD git cherry-pick -x d320f160aa5ff36cdf83c645cca52b615e866e32 # git commit -s git send-email --to '' --in-reply-to '2026031713-ride-olympics-fd2c@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d320f160aa5ff36cdf83c645cca52b615e866e32 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 2 Mar 2026 09:30:02 -0800 Subject: [PATCH] iomap: reject delalloc mappings during writeback Filesystems should never provide a delayed allocation mapping to writeback; they're supposed to allocate the space before replying. This can lead to weird IO errors and crashes in the block layer if the filesystem is being malicious, or if it hadn't set iomap->dev because it's a delalloc mapping. Fix this by failing writeback on delalloc mappings. Currently no filesystems actually misbehave in this manner, but we ought to be stricter about things like that. Cc: stable@vger.kernel.org # v5.5 Fixes: 598ecfbaa742ac ("iomap: lift the xfs writeback code to iomap") Signed-off-by: Darrick J. Wong Link: https://patch.msgid.link/20260302173002.GL13829@frogsfrogsfrogs Reviewed-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Signed-off-by: Christian Brauner diff --git a/fs/iomap/ioend.c b/fs/iomap/ioend.c index 4d1ef8a2cee9..60546fa14dfe 100644 --- a/fs/iomap/ioend.c +++ b/fs/iomap/ioend.c @@ -215,17 +215,18 @@ ssize_t iomap_add_to_ioend(struct iomap_writepage_ctx *wpc, struct folio *folio, WARN_ON_ONCE(!folio->private && map_len < dirty_len); switch (wpc->iomap.type) { - case IOMAP_INLINE: - WARN_ON_ONCE(1); - return -EIO; + case IOMAP_UNWRITTEN: + ioend_flags |= IOMAP_IOEND_UNWRITTEN; + break; + case IOMAP_MAPPED: + break; case IOMAP_HOLE: return map_len; default: - break; + WARN_ON_ONCE(1); + return -EIO; } - if (wpc->iomap.type == IOMAP_UNWRITTEN) - ioend_flags |= IOMAP_IOEND_UNWRITTEN; if (wpc->iomap.flags & IOMAP_F_SHARED) ioend_flags |= IOMAP_IOEND_SHARED; if (folio_test_dropbehind(folio))