aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2024-01-15 21:59:49 -0500
committerTheodore Ts'o <tytso@mit.edu>2024-01-15 21:59:49 -0500
commit1094c175940d38013dd87145c18169f04530c978 (patch)
tree1249dd21564ab9c4498c9e282b8e62571d759313
parent6cde9c20dcea7f1a6085e742da94863636522cb1 (diff)
downloade2fsprogs-1094c175940d38013dd87145c18169f04530c978.tar.gz
debugfs: dx_hash: honor the unsigned hash flag if a file system is opened
If we are using the hash seed and hash version from an open file systenm, then we should also use the unsigned version of the hash algorithm if the superblock as the unsigned hash flag set. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--debugfs/htree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/debugfs/htree.c b/debugfs/htree.c
index fab04e2b3..73a68e92c 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -347,6 +347,9 @@ void do_dx_hash(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
hash_seed[3] = current_fs->super->s_hash_seed[3];
hash_version = current_fs->super->s_def_hash_version;
+ if (hash_version <= EXT2_HASH_TEA &&
+ current_fs->super->s_flags & EXT2_FLAGS_UNSIGNED_HASH)
+ hash_version += 3;
}
reset_getopt();