From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, dedekind1@gmail.com,
david.oberhollenzer@sigma-star.at,
Richard Weinberger <richard@nod.at>
Subject: [PATCH 3/4] ubifs: Add assert to dent_key_init()
Date: Thu, 9 Feb 2017 22:28:36 +0100 [thread overview]
Message-ID: <20170209212837.14197-3-richard@nod.at> (raw)
In-Reply-To: <20170209212837.14197-1-richard@nod.at>
...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.10.2
next prev parent reply other threads:[~2017-02-09 21:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 21:28 [PATCH 1/4] ubifs: Fix data node size for truncating uncompressed nodes Richard Weinberger
2017-02-09 21:28 ` [PATCH 2/4] ubifs: Fix unlink code wrt. double hash lookups Richard Weinberger
2017-03-09 7:04 ` Hyunchul Lee
2017-03-19 20:46 ` Richard Weinberger
2017-07-16 12:12 ` Geert Uytterhoeven
2017-07-16 12:17 ` Richard Weinberger
2017-07-16 12:19 ` Richard Weinberger
2017-02-09 21:28 ` Richard Weinberger [this message]
2017-02-09 21:28 ` [PATCH 4/4] ubifs: Massage debug prints wrt. fscrypt Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170209212837.14197-3-richard@nod.at \
--to=richard@nod.at \
--cc=david.oberhollenzer@sigma-star.at \
--cc=dedekind1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).