From e3b1f2e2b0f84dd16febc8c6dc2771791f37732d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 22 Apr 2020 14:56:06 -0700 Subject: [PATCH] scoutfs: add counters for radix enospc Add counters for the various sources of ENOSPC from the radix block allocator. Signed-off-by: Zach Brown --- kmod/src/counters.h | 3 +++ kmod/src/radix.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kmod/src/counters.h b/kmod/src/counters.h index 8859e646..ab4a9c15 100644 --- a/kmod/src/counters.h +++ b/kmod/src/counters.h @@ -85,6 +85,9 @@ EXPAND_COUNTER(quorum_write_block) \ EXPAND_COUNTER(quorum_write_block_error) \ EXPAND_COUNTER(quorum_fenced) \ + EXPAND_COUNTER(radix_enospc_data) \ + EXPAND_COUNTER(radix_enospc_paths) \ + EXPAND_COUNTER(radix_enospc_synth) \ EXPAND_COUNTER(trans_commit_data_alloc_low) \ EXPAND_COUNTER(trans_commit_fsync) \ EXPAND_COUNTER(trans_commit_full) \ diff --git a/kmod/src/radix.c b/kmod/src/radix.c index 15d80e19..e8e39b42 100644 --- a/kmod/src/radix.c +++ b/kmod/src/radix.c @@ -834,6 +834,7 @@ static int get_path(struct super_block *sb, struct scoutfs_radix_root *root, synth = chg->next_synth++; /* careful not to go too high or wrap */ if (synth == U64_MAX || synth < RADIX_SYNTH_BLKNO) { + scoutfs_inc_counter(sb, radix_enospc_synth); ret = -ENOSPC; goto out; } @@ -992,6 +993,7 @@ static int get_all_paths(struct super_block *sb, /* we're not modifying as we go, check for wrapping */ if (next_meta >= start_meta && meta_wrapped) { + scoutfs_inc_counter(sb, radix_enospc_paths); ret = -ENOSPC; break; } @@ -1276,6 +1278,7 @@ find_next: root->next_find_bit = 0; goto find_next; } + scoutfs_inc_counter(sb, radix_enospc_data); ret = -ENOSPC; } goto out;