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 8132433DEDD for ; Tue, 24 Feb 2026 21:44:36 +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=1771969476; cv=none; b=I3b+clEdTKWhZoC0D5eXFIVajCvbfl4uw1N+xx6Q3wJ7OkcvadLwrgmXdTHDdJ35gkhYhv8j1ztpRbw5mwUqei5Rzd+7SyQ1EpYjw5K17VniV9QCqcwc3qGiM0tVprskXoWTW0VfE+P+wyZkyHCLVEGr4wzXNEJXqTwSjEHAupY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771969476; c=relaxed/simple; bh=NUgBx8Bvpgp9AvPNww9y9RuX8Rq0fAH/DQOEgMfN5GY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=j1i6evGKUMsuFSUDIu+ZqiNfftl877sA8uM5kPfRlbVea4VXSqnf4/zDSbvVRj2q0geC6yCy45Pul1XKc4QLRUxTKXVdMNbnT+tGC8fkDThtmoUOGRMYrjCoUGSWSa0YgUZqppeMxIkMWkGcBBk52RvFbdylMreA3iV0yPcFlqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O+bgLuGE; 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="O+bgLuGE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08559C116D0; Tue, 24 Feb 2026 21:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771969476; bh=NUgBx8Bvpgp9AvPNww9y9RuX8Rq0fAH/DQOEgMfN5GY=; h=Subject:To:Cc:From:Date:From; b=O+bgLuGE1z5CpZkdm47ATMSzwyut/qm+oJlwU/fbbtehWfoAD1R+L5SJbm55+wMcr IIQVMghhvK2k/iVbCNlDwlNO8sfBeHPUS2mAzG3UVeLHqWhT+270rBkhzRcmUffTbI YxQ92bUo1oNm/4VAGiMyBxVXkZ9lqoQHGBgVhdRI= Subject: FAILED: patch "[PATCH] ext4: drop extent cache when splitting extent fails" failed to apply to 5.15-stable tree To: yi.zhang@huawei.com,libaokun1@huawei.com,ojaswin@linux.ibm.com,tytso@mit.edu Cc: From: Date: Tue, 24 Feb 2026 13:44:29 -0800 Message-ID: <2026022429-decline-tucking-14ad@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 5.15-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-5.15.y git checkout FETCH_HEAD git cherry-pick -x 79b592e8f1b435796cbc2722190368e3e8ffd7a1 # git commit -s git send-email --to '' --in-reply-to '2026022429-decline-tucking-14ad@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ 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 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 1094e4923451..945995d68c4d 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; }