linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement
@ 2022-07-19  5:11 Qu Wenruo
  2022-07-19  5:11 ` [PATCH v2 1/4] btrfs: output human readable space info flag Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Qu Wenruo @ 2022-07-19  5:11 UTC (permalink / raw)
  To: linux-btrfs

[Changelog]
v2:
- Add a new line to show the meaning of the metadata dump.
  Previous output only includes the reserved bytes and size bytes,
  but not showing which is which, thus still need to check the code

We have some internal reports of transaction abort with -ENOSPC.

Unfortunately it's really hard to debug, since we really got nothing
other than the error message for most cases.

Also we have helpers like __btrfs_dump_space_info(), it needs enospc_debug
mount option which only makes sense if the user can reproduce the bug
and retry with that mount option.

Considering ENOSPC should not happen for critical paths which failure
means transaction abort, we should dump all space info for debug purpose
if the transaction arbot is caused by -ENOSPC.

And since we're here, also enhance the output of
__btrfs_dump_space_info().

Now it should be more human readable, the exmaple would look like this:

 BTRFS info (device dm-1: state A): dumpping space info:
 BTRFS info (device dm-1: state A): space_info DATA has 1175552 free, is not full
 BTRFS info (device dm-1: state A):   total:         8388608
 BTRFS info (device dm-1: state A):   used:          7163904
 BTRFS info (device dm-1: state A):   pinned:        49152
 BTRFS info (device dm-1: state A):   reserved:      0
 BTRFS info (device dm-1: state A):   may_use:       0
 BTRFS info (device dm-1: state A):   read_only:     0
 BTRFS info (device dm-1: state A): space_info META has 263798784 free, is not full
 BTRFS info (device dm-1: state A):   total:         268435456
 BTRFS info (device dm-1: state A):   used:          180224
 BTRFS info (device dm-1: state A):   pinned:        196608
 BTRFS info (device dm-1: state A):   reserved:      0
 BTRFS info (device dm-1: state A):   may_use:       4194304
 BTRFS info (device dm-1: state A):   read_only:     65536
 BTRFS info (device dm-1: state A): space_info SYS has 8372224 free, is not full
 BTRFS info (device dm-1: state A):   total:         8388608
 BTRFS info (device dm-1: state A):   used:          16384
 BTRFS info (device dm-1: state A):   pinned:        0
 BTRFS info (device dm-1: state A):   reserved:      0
 BTRFS info (device dm-1: state A):   may_use:       0
 BTRFS info (device dm-1: state A):   read_only:     0
 BTRFS info (device dm-1: state A): dumpping metadata reservation:
 BTRFS info (device dm-1: state A):   global:          (3670016/3670016)
 BTRFS info (device dm-1: state A):   trans:           (0/0)
 BTRFS info (device dm-1: state A):   chuunk:          (0/0)
 BTRFS info (device dm-1: state A):   delayed_inode:   (0/0)
 BTRFS info (device dm-1: state A):   delayed_refs:    (524288/524288)
 BTRFS: error (device dm-1: state A) in cleanup_transaction:1971: errno=-28 No space left
 BTRFS info (device dm-1: state EA): forced readonly


Qu Wenruo (4):
  btrfs: output human readable space info flag
  btrfs: make __btrfs_dump_space_info() output better formatted
  btrfs: make DUMP_BLOCK_RSV() to have better output
  btrfs: dump all space infos if we abort transaction due to ENOSPC

 fs/btrfs/ctree.h      |  6 ++--
 fs/btrfs/space-info.c | 72 +++++++++++++++++++++++++++++++++----------
 fs/btrfs/space-info.h |  2 ++
 fs/btrfs/super.c      |  4 ++-
 4 files changed, 64 insertions(+), 20 deletions(-)

-- 
2.37.0


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

end of thread, other threads:[~2022-08-25  3:04 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19  5:11 [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 1/4] btrfs: output human readable space info flag Qu Wenruo
2022-07-19 20:38   ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 2/4] btrfs: make __btrfs_dump_space_info() output better formatted Qu Wenruo
2022-07-19 20:56   ` Sweet Tea Dorminy
2022-07-19 21:38     ` David Sterba
2022-07-19 22:58       ` Qu Wenruo
2022-07-26 18:13         ` David Sterba
2022-07-26 20:53           ` Boris Burkov
2022-07-26 21:39             ` David Sterba
2022-07-26 23:21               ` Boris Burkov
2022-07-27  1:21                 ` Sweet Tea Dorminy
2022-07-27  1:44                   ` Qu Wenruo
2022-07-27 15:09                     ` Sweet Tea Dorminy
2022-07-19  5:11 ` [PATCH v2 3/4] btrfs: make DUMP_BLOCK_RSV() to have better output Qu Wenruo
2022-07-19  5:11 ` [PATCH v2 4/4] btrfs: dump all space infos if we abort transaction due to ENOSPC Qu Wenruo
2022-07-20  0:42   ` Sweet Tea Dorminy
2022-07-20  1:03     ` Qu Wenruo
2022-07-20  1:43       ` Sweet Tea Dorminy
2022-07-20  1:57         ` Qu Wenruo
2022-07-26 18:20       ` David Sterba
2022-07-26 18:38         ` Sweet Tea Dorminy
2022-08-24 15:53 ` [PATCH v2 0/4] btrfs: output more info for -ENOSPC caused transaction abort and other enhancement David Sterba
2022-08-25  3:04   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).