public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qu Wenruo <wqu@suse.com>, David Sterba <dsterba@suse.com>,
	Sasha Levin <sashal@kernel.org>,
	clm@fb.com, josef@toxicpanda.com, linux-btrfs@vger.kernel.org
Subject: [PATCH AUTOSEL 5.18 84/93] btrfs: output mirror number for bad metadata
Date: Thu, 11 Aug 2022 11:42:18 -0400	[thread overview]
Message-ID: <20220811154237.1531313-84-sashal@kernel.org> (raw)
In-Reply-To: <20220811154237.1531313-1-sashal@kernel.org>

From: Qu Wenruo <wqu@suse.com>

[ Upstream commit 8f0ed7d4e7bd87c9207a59d6d887777f632a5ed5 ]

When handling a real world transid mismatch image, it's hard to know
which copy is corrupted, as the error messages just look like this:

  BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0

We don't even know if the retry is caused by btrfs or the VFS retry.

To make things a little easier to read, add mirror number for all
related tree block read errors.

So the above messages would look like this:

  BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 1 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 2 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 1 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
  BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 2 wanted 0xcdcdcdcd found 0x3c0adc8e level 0

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ update messages, add "logical" ]
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/disk-io.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6f30413ed9a9..1f2eef5d1a08 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -256,8 +256,8 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
 		goto out;
 	}
 	btrfs_err_rl(eb->fs_info,
-		"parent transid verify failed on %llu wanted %llu found %llu",
-			eb->start,
+"parent transid verify failed on logical %llu mirror %u wanted %llu found %llu",
+			eb->start, eb->read_mirror,
 			parent_transid, btrfs_header_generation(eb));
 	ret = 1;
 	clear_extent_buffer_uptodate(eb);
@@ -587,21 +587,23 @@ static int validate_extent_buffer(struct extent_buffer *eb)
 
 	found_start = btrfs_header_bytenr(eb);
 	if (found_start != eb->start) {
-		btrfs_err_rl(fs_info, "bad tree block start, want %llu have %llu",
-			     eb->start, found_start);
+		btrfs_err_rl(fs_info,
+			"bad tree block start, mirror %u want %llu have %llu",
+			     eb->read_mirror, eb->start, found_start);
 		ret = -EIO;
 		goto out;
 	}
 	if (check_tree_block_fsid(eb)) {
-		btrfs_err_rl(fs_info, "bad fsid on block %llu",
-			     eb->start);
+		btrfs_err_rl(fs_info, "bad fsid on logical %llu mirror %u",
+			     eb->start, eb->read_mirror);
 		ret = -EIO;
 		goto out;
 	}
 	found_level = btrfs_header_level(eb);
 	if (found_level >= BTRFS_MAX_LEVEL) {
-		btrfs_err(fs_info, "bad tree block level %d on %llu",
-			  (int)btrfs_header_level(eb), eb->start);
+		btrfs_err(fs_info,
+			"bad tree block level, mirror %u level %d on logical %llu",
+			eb->read_mirror, btrfs_header_level(eb), eb->start);
 		ret = -EIO;
 		goto out;
 	}
@@ -612,8 +614,8 @@ static int validate_extent_buffer(struct extent_buffer *eb)
 
 	if (memcmp(result, header_csum, csum_size) != 0) {
 		btrfs_warn_rl(fs_info,
-	"checksum verify failed on %llu wanted " CSUM_FMT " found " CSUM_FMT " level %d",
-			      eb->start,
+"checksum verify failed on logical %llu mirror %u wanted " CSUM_FMT " found " CSUM_FMT " level %d",
+			      eb->start, eb->read_mirror,
 			      CSUM_FMT_VALUE(csum_size, header_csum),
 			      CSUM_FMT_VALUE(csum_size, result),
 			      btrfs_header_level(eb));
@@ -638,8 +640,8 @@ static int validate_extent_buffer(struct extent_buffer *eb)
 		set_extent_buffer_uptodate(eb);
 	else
 		btrfs_err(fs_info,
-			  "block=%llu read time tree block corruption detected",
-			  eb->start);
+		"read time tree block corruption detected on logical %llu mirror %u",
+			  eb->start, eb->read_mirror);
 out:
 	return ret;
 }
-- 
2.35.1


  parent reply	other threads:[~2022-08-11 16:17 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 15:40 [PATCH AUTOSEL 5.18 01/93] fbdev: Restart conflicting fb removal loop when unregistering devices Sasha Levin
2022-08-11 15:40 ` [PATCH AUTOSEL 5.18 02/93] drm/r128: Fix undefined behavior due to shift overflowing the constant Sasha Levin
2022-08-11 15:40 ` [PATCH AUTOSEL 5.18 03/93] ath10k: htt_tx: do not interpret Eth frames as WiFi Sasha Levin
2022-08-11 15:40 ` [PATCH AUTOSEL 5.18 04/93] ath10k: fix misreported tx bandwidth for 160Mhz Sasha Levin
2022-08-11 15:40 ` [PATCH AUTOSEL 5.18 05/93] drm/nouveau: clear output poll workers before nouveau_fbcon_destroy() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 06/93] drm/panfrost: Handle HW_ISSUE_TTRX_2968_TTRX_3162 Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 07/93] drm/panfrost: Don't set L2_MMU_CONFIG quirks Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 08/93] drm/panfrost: Add arm,mali-valhall-jm compatible Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 09/93] ath10k: fix regdomain info of iw reg set/get Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 10/93] bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 11/93] drm/amd/display: fix system hang when PSR exits Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 12/93] drm/amd/display: Detect dpcd_rev when hotplug mst monitor Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 13/93] drm/probe-helper: Default to 640x480 if no EDID on DP Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 14/93] libbpf: Fix an error in 64bit relocation value computation Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 15/93] iavf: Add waiting for response from PF in set mac Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 16/93] drm/amd/display: Fix dpp dto for disabled pipes Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 17/93] drm/amd/display: Reduce frame size in the bouding box for DCN20 Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 18/93] drm/radeon: integer overflow in radeon_mode_dumb_create() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 19/93] drm/radeon: Initialize fences array entries in radeon_sa_bo_next_hole Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 20/93] udmabuf: Set the DMA mask for the udmabuf device (v2) Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 21/93] crypto: octeontx2 - fix potential null pointer access Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 22/93] net/mlx5: Add HW definitions of vport debug counters Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 23/93] selftests/bpf: Avoid skipping certain subtests Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 24/93] drm/amd/display: Fix monitor flash issue Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 25/93] net: phy: marvell-88x2222: set proper phydev->port Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 26/93] selftests: mlxsw: resource_scale: Allow skipping a test Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 27/93] net: make xpcs_do_config to accept advertising for pcs-xpcs and sja1105 Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 28/93] net: stmmac: make mdio register skips PHY scanning for fixed-link Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 29/93] net: dsa: ar9331: fix potential dead lock on mdio access Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 30/93] media: davinci: vpif: add missing of_node_put() in vpif_probe() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 31/93] media: mediatek: vcodec: prevent kernel crash when scp ipi timeout Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 32/93] media: airspy: respect the DMA coherency rules Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 33/93] media: pvrusb2: fix memory leak in pvr_probe Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 34/93] rcu: Apply noinstr to rcu_idle_enter() and rcu_idle_exit() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 35/93] drm/bridge/tc358775: Fix DSI clock division for vsync delay calculation Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 36/93] uprobe: gate bpf call behind BPF_EVENTS Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 37/93] rcutorture: Fix memory leak in rcu_test_debug_objects() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 38/93] rcuscale: Fix smp_processor_id()-in-preemptible warnings Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 39/93] refscale: Convert test_lock spinlock to raw_spinlock Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 40/93] mlxsw: cmd: Increase 'config_profile.flood_mode' length Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 41/93] amdgpu/pm: Fix possible array out-of-bounds if SCLK levels != 2 Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 42/93] media: mediatek: vcodec: return EINVAL if plane is too small Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 43/93] media: atmel: atmel-isc-base: allow wb ctrls to be changed when isc is not configured Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 44/93] media: mediatek: vcodec: Report supported bitrate modes Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 45/93] kselftests: Enable the echo command to print newlines in Makefile Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 46/93] ipv6/addrconf: fix timing bug in tempaddr regen Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 47/93] drm/amdgpu/display/dc: Fix null pointer exception Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 48/93] libbpf: fix up few libbpf.map problems Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 49/93] scripts: get_feat.pl: use /usr/bin/env to find perl Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 50/93] octeontx2-af: fix operand size in bitwise operation Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 51/93] drm/amdgpu: skip whole ras bad page framework on sriov Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 52/93] drm/amd/display: Guard against ddc_pin being NULL for AUX Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 53/93] drm/amd/display: Fix dmub soft hang for PSR 1 Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 54/93] drm/amd/display: disable otg toggle w/a on boot Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 55/93] iov_iter_get_pages{,_alloc}(): cap the maxsize with MAX_RW_COUNT Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 56/93] drm/msm/gem: Drop obj lock in msm_gem_free_object() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 57/93] scripts: sphinx-pre-install: fix venv version check logic Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 58/93] crypto: vmx - Fix warning on p8_ghash_alg Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 59/93] octeontx2-af: Don't reset previous pfc config Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 60/93] libbpf: Disable SEC pragma macro on GCC Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 61/93] bpf: Make non-preallocated allocation low priority Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 62/93] drm/nouveau/nvkm: use list_add_tail() when building object tree Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 63/93] drm/amdgpu: fix file permissions on some files Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 64/93] crypto: ccree - Add missing clk_disable_unprepare() in cc_pm_resume() Sasha Levin
2022-08-11 15:41 ` [PATCH AUTOSEL 5.18 65/93] bpf: Fix check against plain integer v 'NULL' Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 66/93] media: rkisp1: Disable runtime PM in probe error path Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 67/93] drm/amdgpu: Call trace info was found in dmesg when loading amdgpu Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 68/93] net: devlink: avoid false DEADLOCK warning reported by lockdep Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 69/93] bpf: Don't redirect packets with invalid pkt_len Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 70/93] rcu: Avoid tracing a few functions executed in stop machine Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 71/93] can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 72/93] net/cdc_ncm: Increase NTB max RX/TX values to 64kb Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 73/93] Bluetooth: hci_bcm: Add BCM4349B1 variant Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 74/93] Bluetooth: use memset avoid memory leaks Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 75/93] Bluetooth: Collect kcov coverage from hci_rx_work Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 76/93] Bluetooth: btusb: Set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for MTK Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 77/93] Bluetooth: hci_sync: Check LMP feature bit instead of quirk Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 78/93] Bluetooth: btusb: Remove HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for QCA Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 79/93] Bluetooth: btusb: Remove HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for fake CSR Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 80/93] Bluetooth: mgmt: Fix using hci_conn_abort Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 81/93] bpf/selftests: Fix couldn't retrieve pinned program in xdp veth test Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 82/93] drm/amdkfd: Correct mmu_notifier_get failure handling Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 83/93] drm/amdkfd: Process notifier release callback don't take mutex Sasha Levin
2022-08-11 15:42 ` Sasha Levin [this message]
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 85/93] net: ethernet: stmicro: stmmac: first disable all queues and disconnect in release Sasha Levin
2022-08-11 15:42 ` [PATCH AUTOSEL 5.18 86/93] wifi: rtl8xxxu: Fix the error handling of the probe function Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811154237.1531313-84-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox