Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643127 > unrolled thread

[PATCH 4/6] ubifs: Add assert to dent_key_init()

Started byRichard Weinberger <richard@nod.at>
First post2017-05-17 10:40 +0200
Last post2017-05-17 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/6] ubifs: Add assert to dent_key_init() Richard Weinberger <richard@nod.at> - 2017-05-17 10:40 +0200

#1643127 — [PATCH 4/6] ubifs: Add assert to dent_key_init()

FromRichard Weinberger <richard@nod.at>
Date2017-05-17 10:40 +0200
Subject[PATCH 4/6] ubifs: Add assert to dent_key_init()
Message-ID<tI2EW-J3-27@gated-at.bofh.it>
...to make sure that we don't use it for double hashed lookups
instead of dent_key_init_hash().

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/key.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ubifs/key.h b/fs/ubifs/key.h
index 7547be512db2..b1f7c0caa3ac 100644
--- a/fs/ubifs/key.h
+++ b/fs/ubifs/key.h
@@ -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));
 
 	ubifs_assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
+	ubifs_assert(!nm->hash && !nm->minor_hash);
 	key->u32[0] = inum;
 	key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS);
 }
-- 
2.12.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web