public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: add error reports for possible run_one_delayed_ref()
@ 2022-12-26  1:00 Qu Wenruo
  2022-12-26  1:00 ` [PATCH 1/2] btrfs: add extra error message for tree block level mismatch Qu Wenruo
  2022-12-26  1:00 ` [PATCH 2/2] btrfs: always report error for run_one_delayed_ref() Qu Wenruo
  0 siblings, 2 replies; 6+ messages in thread
From: Qu Wenruo @ 2022-12-26  1:00 UTC (permalink / raw)
  To: linux-btrfs

There is a bug report that one can cause error in run_one_delayed_ref()
and make the fs RO.

But there is only two lines of dmesg:

 BTRFS: error (device nvme0n1p3: state A) in btrfs_run_delayed_refs:2147: errno=-5 IO failure
 BTRFS info (device nvme0n1p3: state EA): forced readonly

Which is not really helpful.

This patch will add two error reports which should help us to debug:

- Add the missing level check errors in validate_extent_buffer()
  Failed level checks didn't cause any error message, which is very
  different compared to the other checks.

- Add error report for failed run_one_delayed_ref()
  This will include extra info for each node.

The remaining branches are either calling btrfs_abort_transaction(),
which should provide function and line number, or have extra error
message like alloc_reserved_extent(), or should trigger error messages
from validate_extent_buffer() when failed, like btrfs_insert_empty_item().

Thus this two patches should cover most of the error cases.

Qu Wenruo (2):
  btrfs: add extra error message for tree block level mismatch
  btrfs: always report error for run_one_delayed_ref()

 fs/btrfs/disk-io.c     | 4 ++++
 fs/btrfs/extent-tree.c | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-03  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-26  1:00 [PATCH 0/2] btrfs: add error reports for possible run_one_delayed_ref() Qu Wenruo
2022-12-26  1:00 ` [PATCH 1/2] btrfs: add extra error message for tree block level mismatch Qu Wenruo
2023-01-03  8:36   ` Anand Jain
2022-12-26  1:00 ` [PATCH 2/2] btrfs: always report error for run_one_delayed_ref() Qu Wenruo
2023-01-02 16:45   ` David Sterba
2023-01-03  8:48   ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox