Commit 8b2900c0 authored by Richard Weinberger's avatar Richard Weinberger

ubifs: Add assert to dent_key_init()

...to make sure that we don't use it for double hashed lookups
instead of dent_key_init_hash().
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 781f675e
...@@ -162,6 +162,7 @@ static inline void dent_key_init(const struct ubifs_info *c, ...@@ -162,6 +162,7 @@ static inline void dent_key_init(const struct ubifs_info *c,
uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm)); uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm));
ubifs_assert(!(hash & ~UBIFS_S_KEY_HASH_MASK)); ubifs_assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
ubifs_assert(!nm->hash && !nm->minor_hash);
key->u32[0] = inum; key->u32[0] = inum;
key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS); key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment