Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp263313lqb; Tue, 4 Jun 2024 10:32:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWkcB8ckew7onvkxDyd+v3KfRNiX8KXBvCRS0gIdvFRuh9SnIk5VINpiihNpKBN8MLRzgp60VQPO0ETeCIgaQBquzfbla3RviYYwn5FA== X-Google-Smtp-Source: AGHT+IFC0X6YtJF10HIMCl0qP6yoyMeVpk/cVpb+o5goqBJtKYuhu5Aaco8qIDCdjM8wz99iNNN8 X-Received: by 2002:a05:6a20:12d1:b0:1af:d1b2:4c21 with SMTP id adf61e73a8af0-1b2b713c934mr332103637.41.1717522340544; Tue, 04 Jun 2024 10:32:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717522340; cv=pass; d=google.com; s=arc-20160816; b=FpWAIBFKR5DNlLjmS80bw+hUq/MlybjTMyEJw7ZYhYZHZCh2mV1ZsVU4jyfLlwq5DH Si44Xck3NL6WfwQjvN+W/+3jWL8w3sE0uH6iS1LYIkj+Z4q+WtGqmEQf0KifYYsdZhD6 JlR+bAJKe4UuIdjLyIsTKpMv4Z5RF7+XYxZEtMDgym98ASCe4RrhR6gjBOcDMgGwpMus XGjuYuBzclYMUW35NCvSPqVLCJS4q9h5a81Sb+yG52OS21Bs/xEPH2jiPU5JpiNNZVW6 XfoHTmVKYCOYP2UFVhE0AhRvMJEX1j2Sa8ttz3rUxmbjoc++cWOTB4DJ++DuKr4/o64a DMTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S5ckcVgkbNMC55OLpco9wVT2xKpTJ4VMhrSsxMoFUU8=; fh=7YtuhoXSWBi8ifgMkBpe2TN9pJBfqeD11DryJGfDR2w=; b=kFaV++c9lqgBSwhs08CdHlaUZ3fo1BjdoUOVknEiVQ77Fgb8tbendOmVmN8JH2eCW3 0L4jtkg0fjteB85DvVrHGRl8r9e5m55IHcqAqH4YIfyIAYW8WDn5a/rD6TF+jBMGJFFr GNof4shPrNgRiLuWy+yrQ8/etTPBxnNq+3mre227kpbG+KD33H9Ll5UE5WpFlnN5cUO7 vGtiXsZnUAiGtEaZss1z7O0etK0Cg97JYjzml8cjlYqoV8bP0WsPZ5Pyyo5G9HBO2k6Y kEsUq87Mcb8pwfOblo1ObVi5XaX1pazRQ7Vr3sSgwxonAoWkqrDcUKaLLCdTum3aahYa OgtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M4yaGbJg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2768-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c355aea39csi1704660a12.166.2024.06.04.10.32.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 10:32:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2768-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M4yaGbJg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-ext4+bounces-2768-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FBA9282327 for ; Tue, 4 Jun 2024 17:31:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C647714A0A7; Tue, 4 Jun 2024 17:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M4yaGbJg" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50DCE14A09B for ; Tue, 4 Jun 2024 17:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717522246; cv=none; b=kwoln8TBHx47WFmrcsQWkY57wd5oDD5L+ekm0JmAD3I42aPLeyznaXxx2qGHvSYMn+HQGCcCXl7cvWt51wHpqV4qfZeMB3E8EoEELITPVVOWIG0KFOS3w84AgEyoLEbMytutGYncB100n7MrLtUAfWO0/IUUx+Ur1Esj77w36/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717522246; c=relaxed/simple; bh=sqz1qbKj8sYh1m4kyTeBM2R2X5vDzFS9JdeJ8ZaRFBo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zk84KbBH3BjtjvS4M00W+xu0+MmO9vvho0dD2bGA1Pl4F2mU/V609ExzzA4k/tG4xyOP6ESr1gFLl5X97QxHluEYS84IP8pN4GnBDXPqtj0VBltVmsFHgdTVxnBVGN0P+83KghEhXjDy20WMzjYzOS1lcFUFWNYy0KKhZtyN/Dk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M4yaGbJg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AAB4C2BBFC; Tue, 4 Jun 2024 17:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717522246; bh=sqz1qbKj8sYh1m4kyTeBM2R2X5vDzFS9JdeJ8ZaRFBo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M4yaGbJgPnAl6xNoqEAW0HFA8UkRhwMoy8F1abkiddtt6bJiotYqh3nxhM5tLHNtk e1kmG+dJp9nzQM/a7qxJX4h6Nq5a/QWiF3zlBjEdQ1mWdwaZWQuaEizZoCuDJDEV7S tyZyHjiT2AaORYvsfbrauZD1LYyO5TWbE5sNw8l0kt6xqPuOTqA6rClIOhQctEi1+8 yQOVs+3DTEjv9QaFTefQoYNGSlzX1gaNO4k7VlfCojT71fZRuM6jFBI9Tr2b+cWxGr AtD4VgXygfOkqih3QU8IsKnd6j6IPE/1Ofvbq6UkE2Z15tmFiXQOIlcoPP2TGUjV7w /hIkyxs/p48YA== Date: Tue, 4 Jun 2024 10:30:44 -0700 From: Eric Biggers To: carrion bent Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH Message-ID: <20240604173044.GB1566@sol.localdomain> References: <1717412239-31392-1-git-send-email-carrionbent@163.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1717412239-31392-1-git-send-email-carrionbent@163.com> On Mon, Jun 03, 2024 at 06:57:19PM +0800, carrion bent wrote: > the macro parameter "entry" of EXT4_DIRENT_HASH and > EXT4_DIRENT_MINOR_HASH was not used, but rather the > variable de was directly used, which may be a local > variable inside a function that calls the macros > > Signed-off-by: carrion bent > --- > fs/ext4/ext4.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index 983dad8..04bdd27 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -2338,9 +2338,9 @@ struct ext4_dir_entry_2 { > ((struct ext4_dir_entry_hash *) \ > (((void *)(entry)) + \ > ((8 + (entry)->name_len + EXT4_DIR_ROUND) & ~EXT4_DIR_ROUND))) > -#define EXT4_DIRENT_HASH(entry) le32_to_cpu(EXT4_DIRENT_HASHES(de)->hash) > +#define EXT4_DIRENT_HASH(entry) le32_to_cpu(EXT4_DIRENT_HASHES(entry)->hash) > #define EXT4_DIRENT_MINOR_HASH(entry) \ > - le32_to_cpu(EXT4_DIRENT_HASHES(de)->minor_hash) > + le32_to_cpu(EXT4_DIRENT_HASHES(entry)->minor_hash) > > static inline bool ext4_hash_in_dirent(const struct inode *inode) > { Thanks! Can you call out explicitly in the commit message that (fortunately) all callers pass in 'de', so this bug didn't have an effect? Also, in the commit title, there needs to be a space after "ext4:". Otherwise this patch looks good to me. - Eric