summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-09-28 14:44:06 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-10-18 00:49:48 -0400
commitd8e879377ffb37ba0d3afa0c92bd3b88b849a0a9 (patch)
tree5d7e5cc907ab8a7459d4a80060a929c3087ea527 /fs/bcachefs/opts.c
parentbcachefs: INODE_STR_HASH() for bch_inode_unpacked (diff)
downloadlinux-d8e879377ffb37ba0d3afa0c92bd3b88b849a0a9.tar.gz
linux-d8e879377ffb37ba0d3afa0c92bd3b88b849a0a9.zip
bcachefs: Add hash seed, type to inode_to_text()
This helped with discovering some filesystem corruption fsck has having trouble with: the str_hash type had gotten flipped on one snapshot's version of an inode. All versions of a given inode number have the same hash seed and hash type, since lookups will be done with a single hash/seed and type and see dirents/xattrs from multiple snapshots. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r--fs/bcachefs/opts.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index 68d240126522..6673cbd8bdb9 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -63,7 +63,7 @@ const char * const bch2_compression_opts[] = {
NULL
};
-const char * const bch2_str_hash_types[] = {
+const char * const __bch2_str_hash_types[] = {
BCH_STR_HASH_TYPES()
NULL
};
@@ -115,6 +115,7 @@ PRT_STR_OPT_BOUNDSCHECKED(fs_usage_type, enum bch_fs_usage_type);
PRT_STR_OPT_BOUNDSCHECKED(data_type, enum bch_data_type);
PRT_STR_OPT_BOUNDSCHECKED(csum_type, enum bch_csum_type);
PRT_STR_OPT_BOUNDSCHECKED(compression_type, enum bch_compression_type);
+PRT_STR_OPT_BOUNDSCHECKED(str_hash_type, enum bch_str_hash_type);
static int bch2_opt_fix_errors_parse(struct bch_fs *c, const char *val, u64 *res,
struct printbuf *err)