btrfs: output more info for -ENOSPC caused transaction abort
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 2 repliesIn review
- v24 patches 19 repliesSuperseded
- v14 patches 4 repliesSuperseded
Changes in v3 from the cover letter
- 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.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: output human readable space info flagfs/ | +19 | 0 replies | |
| 2/2 | btrfs: dump all space infos if we abort transaction due to ENOSPCfs/ fs/ fs/ +1 more | +33 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Johannes Thumshirn |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] btrfs: output more info for -ENOSPC caused transaction abort
[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(-)
Signature · 1 line
2.37.2