* [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
@ 2024-06-03 10:57 carrion bent
2024-06-04 17:30 ` Eric Biggers
2024-06-06 5:43 ` [PATCH v2] ext4: fix " carrion bent
0 siblings, 2 replies; 5+ messages in thread
From: carrion bent @ 2024-06-03 10:57 UTC (permalink / raw)
To: tytso, adilger.kernel; +Cc: linux-ext4, carrion bent
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 <carrionbent@163.com>
---
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)
{
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
2024-06-03 10:57 [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH carrion bent
@ 2024-06-04 17:30 ` Eric Biggers
2024-06-06 5:43 ` [PATCH v2] ext4: fix " carrion bent
1 sibling, 0 replies; 5+ messages in thread
From: Eric Biggers @ 2024-06-04 17:30 UTC (permalink / raw)
To: carrion bent; +Cc: tytso, adilger.kernel, linux-ext4
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 <carrionbent@163.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v2] ext4: fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
2024-06-03 10:57 [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH carrion bent
2024-06-04 17:30 ` Eric Biggers
@ 2024-06-06 5:43 ` carrion bent
2024-07-19 12:21 ` Jan Kara
2024-08-22 15:00 ` Theodore Ts'o
1 sibling, 2 replies; 5+ messages in thread
From: carrion bent @ 2024-06-06 5:43 UTC (permalink / raw)
To: tytso, adilger.kernel; +Cc: linux-ext4, carrion bent
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.
Fortunately, all callers have passed in 'de' so far,
so this bug didn't have an effect.
Signed-off-by: carrion bent <carrionbent@linux.alibaba.com>
---
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)
{
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] ext4: fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
2024-06-06 5:43 ` [PATCH v2] ext4: fix " carrion bent
@ 2024-07-19 12:21 ` Jan Kara
2024-08-22 15:00 ` Theodore Ts'o
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kara @ 2024-07-19 12:21 UTC (permalink / raw)
To: Ted Tso; +Cc: adilger.kernel, linux-ext4, carrion bent
On Thu 06-06-24 13:43:16, 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.
> Fortunately, all callers have passed in 'de' so far,
> so this bug didn't have an effect.
>
> Signed-off-by: carrion bent <carrionbent@linux.alibaba.com>
Ted, this seems to have fallen through the cracks. The bug in the macro is
really nasty trap...
Honza
> ---
> 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)
> {
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] ext4: fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
2024-06-06 5:43 ` [PATCH v2] ext4: fix " carrion bent
2024-07-19 12:21 ` Jan Kara
@ 2024-08-22 15:00 ` Theodore Ts'o
1 sibling, 0 replies; 5+ messages in thread
From: Theodore Ts'o @ 2024-08-22 15:00 UTC (permalink / raw)
To: adilger.kernel, carrion bent; +Cc: Theodore Ts'o, linux-ext4
On Thu, 06 Jun 2024 13:43:16 +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.
> Fortunately, all callers have passed in 'de' so far,
> so this bug didn't have an effect.
>
> [...]
Applied, thanks!
[1/1] ext4: fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH
commit: f67fbacd923f280c55b9e26e49650331446ef335
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-22 15:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 10:57 [PATCH] ext4:fix macro definition error of EXT4_DIRENT_HASH and EXT4_DIRENT_MINOR_HASH carrion bent
2024-06-04 17:30 ` Eric Biggers
2024-06-06 5:43 ` [PATCH v2] ext4: fix " carrion bent
2024-07-19 12:21 ` Jan Kara
2024-08-22 15:00 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox