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 D34D3430B90; Sun, 1 Mar 2026 01:33:14 +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=1772328794; cv=none; b=o5JeEmTzTgLrLdCbYuZOSo5MofbyD6DjHzv/E8v5fK4SjSnAbYjFRLoeYq83FP5HCZaVw+Fmm+VvVe8wJqye4C1++xF5BJelz3NyYKWf/CtV6OD7qY8qu+TV1dHtS86ucI/y+1An3ZAyBjsVOD1603lvSMcQkS2fRk7GbU+1V2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328794; c=relaxed/simple; bh=0fRNTgrx0UlyxPfC1d8pkMSXEO+ZhtJ8kQ0u6Q3z5FE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TvAg/m/bLb+2tWA6AusNuqDV3qftZ3mMLzqSFLiraBi3I+SihyHvW38ljHEfrj8L9MLMH8z5DYSTC5OsOe/VoeXjDWohET+LWqmADKU7gQwQYn1PQed/6wJqytnjgHjqRFNOaVV7KGqhhZdlMX4ZCVmHQGL5enXMkjHgO24j58Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B8A5PpLW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B8A5PpLW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 099C2C19425; Sun, 1 Mar 2026 01:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772328794; bh=0fRNTgrx0UlyxPfC1d8pkMSXEO+ZhtJ8kQ0u6Q3z5FE=; h=From:To:Cc:Subject:Date:From; b=B8A5PpLWVHJAWPSmDE6RhjQWfn8br9VMr1tPG53W6//cSBjFSE/nLlgkso3yM/RtR OecNvF84lAWTvpXZVxeffjp5bQwtu2Fvz/x+wmg5QpFC83vyS+WiCB1tpb/DTfmVx2 Cew81aFhLEdpKQD4bDIEAFk2HgJgESpa9pTHexff/qPIBzP47p/yxLeR2XlXsTrkZI W3caosUnjs+7q5WOiLRhT52b/VNHtsI5JseAP6TS+Wzgc4zUKQAJeKEGYkcsMgoAOK 6cCHewqJiJij2P4I+vo+rmZDyzhlyxWg5Q3JZkOGFWO4bTxeBLdWzBefCjZQxgFAzp aqXhuqCnIBAmg== From: Sasha Levin To: stable@vger.kernel.org, yi.zhang@huawei.com Cc: Baokun Li , stable@kernel.org, Ojaswin Mujoo , Theodore Ts'o , linux-ext4@vger.kernel.org Subject: FAILED: Patch "ext4: drop extent cache when splitting extent fails" failed to apply to 6.6-stable tree Date: Sat, 28 Feb 2026 20:33:12 -0500 Message-ID: <20260301013312.1692402-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-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 . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 79b592e8f1b435796cbc2722190368e3e8ffd7a1 Mon Sep 17 00:00:00 2001 From: Zhang Yi Date: Sat, 29 Nov 2025 18:32:39 +0800 Subject: [PATCH] ext4: drop extent cache when splitting extent fails When the split extent fails, we might leave some extents still being processed and return an error directly, which will result in stale extent entries remaining in the extent status tree. So drop all of the remaining potentially stale extents if the splitting fails. Signed-off-by: Zhang Yi Reviewed-by: Baokun Li Cc: stable@kernel.org Reviewed-by: Ojaswin Mujoo Message-ID: <20251129103247.686136-8-yi.zhang@huaweicloud.com> Signed-off-by: Theodore Ts'o --- fs/ext4/extents.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 1094e49234513..945995d68c4d3 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3267,7 +3267,7 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle, err = PTR_ERR(path); if (err != -ENOSPC && err != -EDQUOT && err != -ENOMEM) - return path; + goto out_path; /* * Get a new path to try to zeroout or fix the extent length. @@ -3281,7 +3281,7 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle, if (IS_ERR(path)) { EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %ld", split, PTR_ERR(path)); - return path; + goto out_path; } depth = ext_depth(inode); ex = path[depth].p_ext; @@ -3358,6 +3358,10 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle, ext4_free_ext_path(path); path = ERR_PTR(err); } +out_path: + if (IS_ERR(path)) + /* Remove all remaining potentially stale extents. */ + ext4_es_remove_extent(inode, ee_block, ee_len); ext4_ext_show_leaf(inode, path); return path; } -- 2.51.0