All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] btrfs: output more info for -ENOSPC caused transaction abort
@ 2022-08-25  7:09 Qu Wenruo
  2022-08-25  7:09 ` [PATCH v3 1/2] btrfs: output human readable space info flag Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Qu Wenruo @ 2022-08-25  7:09 UTC (permalink / raw)
  To: linux-btrfs

[Changelog]
v3:
- Drop the multi-line output change
  The biggest problem is, for the space info dump, it can be ratelimited
  especially for enospc_debug mount option.
  Thus multi-line can be more confusing when it's related-limited or
  interrupted by other lines.

  So this version will reuse the old single line output.

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.

One example of the output at transaction abort time:

 ------------[ cut here ]------------
 BTRFS: Transaction aborted (error -28)
 WARNING: CPU: 8 PID: 3366 at fs/btrfs/transaction.c:2137 btrfs_commit_transaction+0xf81/0xfb0 [btrfs]
 <call trace skipped>
 ---[ end trace 0000000000000000 ]---
 BTRFS info (device dm-1: state A): dumping space info:
 BTRFS info (device dm-1: state A): space_info DATA has 6791168 free, is not full
 BTRFS info (device dm-1: state A): space_info total=8388608, used=1597440, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0
 BTRFS info (device dm-1: state A): space_info METADATA has 257114112 free, is not full
 BTRFS info (device dm-1: state A): space_info total=268435456, used=131072, pinned=180224, reserved=65536, may_use=10878976, readonly=65536 zone_unusable=0
 BTRFS info (device dm-1: state A): space_info SYS has 8372224 free, is not full
 BTRFS info (device dm-1: state A): space_info total=8388608, used=16384, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0
 BTRFS info (device dm-1: state A): global_block_rsv: size 3670016 reserved 3670016
 BTRFS info (device dm-1: state A): trans_block_rsv: size 0 reserved 0
 BTRFS info (device dm-1: state A): chunk_block_rsv: size 0 reserved 0
 BTRFS info (device dm-1: state A): delayed_block_rsv: size 4063232 reserved 4063232
 BTRFS info (device dm-1: state A): delayed_refs_rsv: size 3145728 reserved 3145728
 BTRFS: error (device dm-1: state A) in btrfs_commit_transaction:2137: errno=-28 No space left
 BTRFS info (device dm-1: state EA): forced readonly


Qu Wenruo (2):
  btrfs: output human readable space info flag
  btrfs: dump all space infos if we abort transaction due to ENOSPC

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

-- 
2.37.2


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

end of thread, other threads:[~2022-09-02 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25  7:09 [PATCH v3 0/2] btrfs: output more info for -ENOSPC caused transaction abort Qu Wenruo
2022-08-25  7:09 ` [PATCH v3 1/2] btrfs: output human readable space info flag Qu Wenruo
2022-08-25  7:09 ` [PATCH v3 2/2] btrfs: dump all space infos if we abort transaction due to ENOSPC Qu Wenruo
2022-08-25  8:18   ` Johannes Thumshirn
2022-09-02 13:43 ` [PATCH v3 0/2] btrfs: output more info for -ENOSPC caused transaction abort David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.