diff --git a/kmod/src/wkic.c b/kmod/src/wkic.c index 44eef494..8ae3bb06 100644 --- a/kmod/src/wkic.c +++ b/kmod/src/wkic.c @@ -30,6 +30,7 @@ #include "counters.h" #include "scoutfs_trace.h" #include "wkic.h" +#include "msg.h" /* * This weaker item cache differs from the core item cache in item.c: @@ -746,6 +747,16 @@ static void fill_page_items(struct super_block *sb, struct wkic_page *wpage, str rb_erase(&witem->node, root); kfree(witem); continue; + } else if (tval->count == 0) { + /* + * BUG: there are no contributing items but count != 0, + * which shouldn't happen - we've gone off kilt. + */ + scoutfs_err(sb, "non-zero value for zero count totl "SK_FMT", dropping item", + SK_ARG(&witem->key)); + rb_erase(&witem->node, root); + kfree(witem); + continue; } }