mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: add btree corruption messages
Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "counters.h"
|
||||
#include "triggers.h"
|
||||
#include "options.h"
|
||||
#include "msg.h"
|
||||
|
||||
#include "scoutfs_trace.h"
|
||||
|
||||
@@ -1145,6 +1146,15 @@ restart:
|
||||
|
||||
/* XXX more aggressive block verification, before ref updates? */
|
||||
if (bt->level != level) {
|
||||
scoutfs_corruption(sb, SC_BTREE_BLOCK_LEVEL,
|
||||
corrupt_btree_block_level,
|
||||
"root_height %u root_blkno %llu root_seq %llu blkno %llu seq %llu level %u expected %u",
|
||||
root->height,
|
||||
le64_to_cpu(root->ref.blkno),
|
||||
le64_to_cpu(root->ref.seq),
|
||||
le64_to_cpu(bt->blkno),
|
||||
le64_to_cpu(bt->seq), bt->level,
|
||||
level);
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
@@ -1177,6 +1187,15 @@ restart:
|
||||
/* Find the next child block for the search key. */
|
||||
pos = find_pos(bt, key, key_len, &cmp);
|
||||
if (pos >= nr) {
|
||||
scoutfs_corruption(sb, SC_BTREE_NO_CHILD_REF,
|
||||
corrupt_btree_block_level,
|
||||
"root_height %u root_blkno %llu root_seq %llu blkno %llu seq %llu level %u nr %u pos %u cmp %d",
|
||||
root->height,
|
||||
le64_to_cpu(root->ref.blkno),
|
||||
le64_to_cpu(root->ref.seq),
|
||||
le64_to_cpu(bt->blkno),
|
||||
le64_to_cpu(bt->seq), bt->level,
|
||||
nr, pos, cmp);
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
EXPAND_COUNTER(compact_stale_error) \
|
||||
EXPAND_COUNTER(compact_sticky_upper) \
|
||||
EXPAND_COUNTER(compact_sticky_written) \
|
||||
EXPAND_COUNTER(corrupt_btree_block_level) \
|
||||
EXPAND_COUNTER(corrupt_btree_no_child_ref) \
|
||||
EXPAND_COUNTER(corrupt_dirent_backref_name_len) \
|
||||
EXPAND_COUNTER(corrupt_dirent_name_len) \
|
||||
EXPAND_COUNTER(corrupt_dirent_readdir_name_len) \
|
||||
|
||||
@@ -655,6 +655,8 @@ enum {
|
||||
SC_SYMLINK_INODE_SIZE,
|
||||
SC_SYMLINK_MISSING_ITEM,
|
||||
SC_SYMLINK_NOT_NULL_TERM,
|
||||
SC_BTREE_BLOCK_LEVEL,
|
||||
SC_BTREE_NO_CHILD_REF,
|
||||
SC_NR_SOURCES,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user