From patchwork Thu Feb 9 21:28:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 726334 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vKB6N45QLz9s7t for ; Fri, 10 Feb 2017 08:29:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bYKlPXeW"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MS40LfUR2JOcUB3f92VtTF49vZfWSDMb9RVyAY6Kq5g=; b=bYKlPXeWNPfd5DgdeQb5BXUmoC ZK7oWfkdkED4AGh/1+Lf8e+/GsOCdtZ0ePL7PLb6mmuJ7S37S3RXRzPKFfKgnYFaO9kQPv60PyaQI lDmfgvNe9utULpTZMRPipYONNf8yYQD6FI7I5zBKiYCILJ3C95C7eLuwsjZy9rFOjV34dTuBmwCsZ 71OVmAmeyKVnvLupbLniqKUF1e+SrDQpglvG1eg3XXQg5LZX+N8IxUExg9JF8Zz/NsQbIn+57hHzF 0AcM95/lQ/zkxqLMlk4lu/m2clKcrGXeHG9mvfGH+2WbpmVXoQkLuaV2TS046s5tSd9txJ+Ztrarm dbbf75XQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbwH9-0006Df-Up; Thu, 09 Feb 2017 21:29:11 +0000 Received: from mail.sigma-star.at ([95.130.255.111]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbwH3-0006Av-SW for linux-mtd@lists.infradead.org; Thu, 09 Feb 2017 21:29:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sigma-star.at (Postfix) with ESMTP id 2F7FA24E0001; Thu, 9 Feb 2017 22:28:42 +0100 (CET) Received: from spankyham.sigmapriv.at (unknown [82.150.214.13]) by mail.sigma-star.at (Postfix) with ESMTPSA id AF31D24E0003; Thu, 9 Feb 2017 22:28:41 +0100 (CET) From: Richard Weinberger To: linux-mtd@lists.infradead.org Subject: [PATCH 3/4] ubifs: Add assert to dent_key_init() Date: Thu, 9 Feb 2017 22:28:36 +0100 Message-Id: <20170209212837.14197-3-richard@nod.at> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170209212837.14197-1-richard@nod.at> References: <20170209212837.14197-1-richard@nod.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170209_132906_103086_42C7B084 X-CRM114-Status: GOOD ( 11.01 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , david.oberhollenzer@sigma-star.at, linux-kernel@vger.kernel.org, dedekind1@gmail.com MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ...to make sure that we don't use it for double hashed lookups instead of dent_key_init_hash(). Signed-off-by: Richard Weinberger --- 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); }