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 A163613B58A; Sun, 1 Mar 2026 02:03:11 +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=1772330591; cv=none; b=RhpLguJstTccFHc39D6RwHr8/UcOjjdSO6Cw9NEcKVjX5IaF9BmYhluUNzUQmsxRjhyFrW7n8f5H8in51QgNUgB4nNMr+aTuUV1Z/Gy2ZJTNibECmXHXk+CiHCrErUZu4LaS2HcXOjoU6AyIQE5P6b5SZUYcwjBiGTMyfPkUx9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330591; c=relaxed/simple; bh=WU80f5l1RMCJl5rxGkTU++19cKKrmlmqqP103liP7DI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bpviAwtsGBPyFKLmIXNi50Ox8iCXY6lyYGIuqHCRzjn7ZRs7aQc6eSUdaZVuwwLFZHxPlVOfsdhD8kfJsh8fETGZFY1KqSJU0PitdjS40WilplZnIC9TPC3tpdEhULHjoHFHK+zJ/x6cjD2Rqk4A1vUkW3OIGXIQmIctemok/UE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SPHUKhXO; 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="SPHUKhXO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD8D7C19424; Sun, 1 Mar 2026 02:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330591; bh=WU80f5l1RMCJl5rxGkTU++19cKKrmlmqqP103liP7DI=; h=From:To:Cc:Subject:Date:From; b=SPHUKhXO44WWEJDrhRDvZK6kNVxe6iEWOWtY7IXwICw5RQX6/v3ZqTaeMWRMc+i4u v9yE5ZVYHcIeMNqO5fqaqx7rDTxxtWZ52qjhJYJsJr3iqyhDMRlx46PY0MJlVm0yzL pU85rO6H5hosGMbd16ZFkdoQEuIb2RIDc3DaiXAH1j8miS93uU3S5oxcN2WJ1c3beY MCu5mUoBLjsJkHLGipf3lgZct5a6IBIkmoTXqZC7Sd2OlmHPnM0GQruvUp8NclLVKk KusRjqiJZq2jwhFWQWJ47G6UGYLiXZgidaGRF0rvWeKoY8Xpv1wgNBf3zAtcq0JO3L Uvy92MKlLun8w== From: Sasha Levin To: stable@vger.kernel.org, jinbaohong@synology.com Cc: Qu Wenruo , Robbie Ko , Filipe Manana , David Sterba , linux-btrfs@vger.kernel.org Subject: FAILED: Patch "btrfs: continue trimming remaining devices on failure" failed to apply to 5.10-stable tree Date: Sat, 28 Feb 2026 21:03:09 -0500 Message-ID: <20260301020309.1731147-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-btrfs@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 5.10-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 912d1c6680bdb40b72b1b9204706f32b6eb842c3 Mon Sep 17 00:00:00 2001 From: jinbaohong Date: Wed, 28 Jan 2026 07:06:38 +0000 Subject: [PATCH] btrfs: continue trimming remaining devices on failure Commit 93bba24d4b5a ("btrfs: Enhance btrfs_trim_fs function to handle error better") intended to make device trimming continue even if one device fails, tracking failures and reporting them at the end. However, it used 'break' instead of 'continue', causing the loop to exit on the first device failure. Fix this by replacing 'break' with 'continue'. Fixes: 93bba24d4b5a ("btrfs: Enhance btrfs_trim_fs function to handle error better") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo Signed-off-by: Robbie Ko Signed-off-by: jinbaohong Reviewed-by: Filipe Manana Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a91bce05ffb4c..b63296e9abf48 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -6688,7 +6688,7 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range) if (ret) { dev_failed++; dev_ret = ret; - break; + continue; } } mutex_unlock(&fs_devices->device_list_mutex); -- 2.51.0