scoutfs: scoutfs_bug_on to show bad append order

Use scoutfs_bug_on() to freak out if we append items to a segment out of
order.  We don't really return errors from this path, we should, but for
now at least share the keys that show the problem.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-03-27 12:45:07 -07:00
committed by Mark Swan
parent 704714c2ee
commit 62e26c5d96

View File

@@ -27,6 +27,7 @@
#include "key.h"
#include "counters.h"
#include "triggers.h"
#include "msg.h"
#include "scoutfs_trace.h"
/*
@@ -664,7 +665,9 @@ bool scoutfs_seg_append_item(struct super_block *sb, struct scoutfs_segment *seg
off = le32_to_cpu(sblk->last_item_off);
if (off) {
item = off_ptr(seg, off);
BUG_ON(scoutfs_key_compare(key, &item->key) <= 0);
scoutfs_bug_on(sb, scoutfs_key_compare(key, &item->key) <= 0,
"key "SK_FMT" item->key "SK_FMT,
SK_ARG(key), SK_ARG(&item->key));
}
nr_links = skip_next_nr(le32_to_cpu(sblk->nr_items));