From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C9EA13F3285 for ; Mon, 24 Aug 2026 12:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787574420; cv=none; b=nyummJajaF2n+fQqbDsXOh5GqNdEJARH12f2OOtMpFiy/+vggT6Q9x1PHgM5QGlwsAnEuRaPHxYdezJJn8ahIrW5VbpaOqUEkOb0+Kwl9hwSTKYcEMjwZKBgdB/ROsl724+MwhtpkhBFSeGxSrcUAocCQKSAuwt01JYYByV9JNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787574420; c=relaxed/simple; bh=mc3AYyEPCmvna7cSKMkkI8XGaYMwZkB55knCT7kGXbQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=RzSGbK3ux3nGUNCnuKeD/H4Mf16V8yfnZ7AXuOMLjGNW3OYEFNPnTkScTXWMeANPnLbUwp4t4XF2Q2VFxbn25PaRzi7N8Ahrkinob7tesNhra/UEEUaJ+n0DRQ6J2vyDo8oIIb+G7k8iU1bLDHxHmEtaeA2C/WpxF6WLBoekYnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=iKxudNfn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="iKxudNfn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D77C41F000E9; Mon, 24 Aug 2026 12:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787574418; bh=NEO3W4/PZ96sT3SWI99cGAIb0cgtpajUHVxj2AcIuKI=; h=Subject:To:Cc:From:Date; b=iKxudNfnY+or7bXCM/Ij57h1u6OzliV9bJA+tv+vumzC9Rlf7MKcp0X/loKcOCSYG PUbhAegNAZyqRosr6DDYLrAwfHkFx6CpF0XaRNyCV8nz26bMIgnGHT7jImCGkqh/jU h08TbhST4LytMFYrjW57I0Rx01exNvy1wFk/Gd/8= Subject: FAILED: patch "[PATCH] ext4: propagate errors from fast commit range replay" failed to apply to 6.6-stable tree To: 3497809730@qq.com,jack@suse.cz,tytso@mit.edu Cc: From: Date: Mon, 24 Aug 2026 14:26:54 +0200 Message-ID: <2026082454-agent-feisty-8c0c@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.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 . 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.6.y git checkout FETCH_HEAD git cherry-pick -x d8b8dd3530bf41e14b118702cdaf9de64bb96885 # git commit -s git send-email --to '' --in-reply-to '2026082454-agent-feisty-8c0c@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d8b8dd3530bf41e14b118702cdaf9de64bb96885 Mon Sep 17 00:00:00 2001 From: Guanghui Yang <3497809730@qq.com> Date: Wed, 8 Jul 2026 08:12:04 +0000 Subject: [PATCH] ext4: propagate errors from fast commit range replay ext4_fc_replay() stops replaying fast commit tags only when a tag handler returns a negative error. However, ext4_fc_replay_add_range() and ext4_fc_replay_del_range() currently return 0 from their common exit paths even after internal failures. This hides errors from ext4_fc_record_modified_inode(), ext4_map_blocks(), ext4_find_extent(), ext4_ext_insert_extent(), ext4_ext_replay_update_ex(), and ext4_ext_remove_space(). As a result, a failed ADD_RANGE or DEL_RANGE replay can be treated as successful and the replay code may continue with subsequent fast commit tags. This is particularly problematic for DEL_RANGE because it may already have marked blocks as free before ext4_ext_remove_space() fails. If the error is swallowed, replay may continue from a partially applied range operation. Return the saved error from the common exit paths and make the ERR_PTR() cases in ADD_RANGE store PTR_ERR() before jumping to out. Fixes: 8016e29f4362 ("ext4: fast commit recovery path") Cc: stable@vger.kernel.org Signed-off-by: Guanghui Yang <3497809730@qq.com> Reviewed-by: Jan Kara Link: https://patch.msgid.link/tencent_E3622146846A84C75C31C7D32AC4D5AD0605@qq.com Signed-off-by: Theodore Ts'o diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index ca72a52f8cc9..062103e42cd8 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -2177,8 +2177,11 @@ static int ext4_fc_replay_add_range(struct super_block *sb, u8 *val) if (ret == 0) { /* Range is not mapped */ path = ext4_find_extent(inode, cur, path, 0); - if (IS_ERR(path)) + if (IS_ERR(path)) { + ret = PTR_ERR(path); + path = NULL; goto out; + } memset(&newex, 0, sizeof(newex)); newex.ee_block = cpu_to_le32(cur); ext4_ext_store_pblock( @@ -2190,8 +2193,11 @@ static int ext4_fc_replay_add_range(struct super_block *sb, u8 *val) path = ext4_ext_insert_extent(NULL, inode, path, &newex, 0); up_write((&EXT4_I(inode)->i_data_sem)); - if (IS_ERR(path)) + if (IS_ERR(path)) { + ret = PTR_ERR(path); + path = NULL; goto out; + } goto next; } @@ -2238,10 +2244,11 @@ static int ext4_fc_replay_add_range(struct super_block *sb, u8 *val) } ext4_ext_replay_shrink_inode(inode, i_size_read(inode) >> sb->s_blocksize_bits); + ret = 0; out: ext4_free_ext_path(path); iput(inode); - return 0; + return ret; } /* Replay DEL_RANGE tag */ @@ -2301,9 +2308,10 @@ ext4_fc_replay_del_range(struct super_block *sb, u8 *val) ext4_ext_replay_shrink_inode(inode, i_size_read(inode) >> sb->s_blocksize_bits); ext4_mark_inode_dirty(NULL, inode); + ret = 0; out: iput(inode); - return 0; + return ret; } static void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)