summaryrefslogtreecommitdiff
path: root/fs/bcachefs/sysfs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-07-12 23:52:49 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-04-17 15:43:05 -0400
commit5d209e24f4f46553552dd75ce89a72dbf2a35844 (patch)
treec7e87218f2274a2a530d898e2b5329b8053dd486 /fs/bcachefs/sysfs.c
parentbd9da5c9b218357914d9084e0a5038845deab115 (diff)
bcachefs: Add open_buckets to sysfs
This is to help debug a rare shutdown deadlock in the allocator code - the btree code is leaking open_buckets. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r--fs/bcachefs/sysfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index 84a7acb04d01..9b1ffbf96e14 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -171,6 +171,7 @@ read_attribute(btree_cache);
read_attribute(btree_key_cache);
read_attribute(btree_transactions);
read_attribute(stripes_heap);
+read_attribute(open_buckets);
read_attribute(internal_uuid);
@@ -409,6 +410,11 @@ SHOW(bch2_fs)
return out.pos - buf;
}
+ if (attr == &sysfs_open_buckets) {
+ bch2_open_buckets_to_text(&out, c);
+ return out.pos - buf;
+ }
+
if (attr == &sysfs_compression_stats) {
bch2_compression_stats_to_text(&out, c);
return out.pos - buf;
@@ -567,6 +573,7 @@ struct attribute *bch2_fs_internal_files[] = {
&sysfs_btree_key_cache,
&sysfs_btree_transactions,
&sysfs_stripes_heap,
+ &sysfs_open_buckets,
&sysfs_read_realloc_races,
&sysfs_extent_migrate_done,