File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,28 @@ const struct bch_sb_field_ops bch_sb_field_ops_errors = {
78
78
.to_text = bch2_sb_errors_to_text ,
79
79
};
80
80
81
+ void bch2_fs_errors_to_text (struct printbuf * out , struct bch_fs * c )
82
+ {
83
+ if (out -> nr_tabstops < 1 )
84
+ printbuf_tabstop_push (out , 48 );
85
+ if (out -> nr_tabstops < 2 )
86
+ printbuf_tabstop_push (out , 8 );
87
+ if (out -> nr_tabstops < 3 )
88
+ printbuf_tabstop_push (out , 16 );
89
+
90
+ guard (mutex )(& c -> fsck_error_counts_lock );
91
+
92
+ bch_sb_errors_cpu * e = & c -> fsck_error_counts ;
93
+ darray_for_each (* e , i ) {
94
+ bch2_sb_error_id_to_text (out , i -> id );
95
+ prt_tab (out );
96
+ prt_u64 (out , i -> nr );
97
+ prt_tab (out );
98
+ bch2_prt_datetime (out , i -> last_error_time );
99
+ prt_newline (out );
100
+ }
101
+ }
102
+
81
103
void bch2_sb_error_count (struct bch_fs * c , enum bch_sb_error_id err )
82
104
{
83
105
bch_sb_errors_cpu * e = & c -> fsck_error_counts ;
Original file line number Diff line number Diff line change 7
7
extern const char * const bch2_sb_error_strs [];
8
8
9
9
void bch2_sb_error_id_to_text (struct printbuf * , enum bch_sb_error_id );
10
+ void bch2_fs_errors_to_text (struct printbuf * , struct bch_fs * );
10
11
11
12
extern const struct bch_sb_field_ops bch_sb_field_ops_errors ;
12
13
Original file line number Diff line number Diff line change 37
37
#include "rebalance.h"
38
38
#include "recovery_passes.h"
39
39
#include "replicas.h"
40
+ #include "sb-errors.h"
40
41
#include "super-io.h"
41
42
#include "tests.h"
42
43
@@ -172,6 +173,7 @@ read_attribute(btree_write_stats);
172
173
173
174
read_attribute (btree_cache_size );
174
175
read_attribute (compression_stats );
176
+ read_attribute (errors );
175
177
read_attribute (journal_debug );
176
178
read_attribute (btree_cache );
177
179
read_attribute (btree_key_cache );
@@ -353,6 +355,9 @@ SHOW(bch2_fs)
353
355
if (attr == & sysfs_compression_stats )
354
356
bch2_compression_stats_to_text (out , c );
355
357
358
+ if (attr == & sysfs_errors )
359
+ bch2_fs_errors_to_text (out , c );
360
+
356
361
if (attr == & sysfs_new_stripes )
357
362
bch2_new_stripes_to_text (out , c );
358
363
@@ -483,6 +488,7 @@ struct attribute *bch2_fs_files[] = {
483
488
& sysfs_recovery_status ,
484
489
485
490
& sysfs_compression_stats ,
491
+ & sysfs_errors ,
486
492
487
493
#ifdef CONFIG_BCACHEFS_TESTS
488
494
& sysfs_perf_test ,
You can’t perform that action at this time.
0 commit comments