From: Vasiliy Kovalev <kovalev@altlinux.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sasha Levin <sashal@kernel.org>,
stable@vger.kernel.org
Cc: lvc-project@linuxtesting.org, dutyrok@altlinux.org,
gerben@altlinux.org, kovalev@altlinux.org
Subject: [PATCH 1/3] ext4: factor out ext4_hash_info_init()
Date: Mon, 18 Nov 2024 13:20:48 +0300 [thread overview]
Message-ID: <20241118102050.16077-2-kovalev@altlinux.org> (raw)
In-Reply-To: <20241118102050.16077-1-kovalev@altlinux.org>
From: Jason Yan <yanaijie@huawei.com>
[ Upstream commit db9345d9e6f075e1ec26afadf744078ead935fec ]
Factor out ext4_hash_info_init() to simplify __ext4_fill_super(). No
functional change.
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20230323140517.1070239-2-yanaijie@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/super.c | 50 +++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3bf214d4afef5..cf2c8cf507780 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5042,6 +5042,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
+static void ext4_hash_info_init(struct super_block *sb)
+{
+ struct ext4_sb_info *sbi = EXT4_SB(sb);
+ struct ext4_super_block *es = sbi->s_es;
+ unsigned int i;
+
+ for (i = 0; i < 4; i++)
+ sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
+
+ sbi->s_def_hash_version = es->s_def_hash_version;
+ if (ext4_has_feature_dir_index(sb)) {
+ i = le32_to_cpu(es->s_flags);
+ if (i & EXT2_FLAGS_UNSIGNED_HASH)
+ sbi->s_hash_unsigned = 3;
+ else if ((i & EXT2_FLAGS_SIGNED_HASH) == 0) {
+#ifdef __CHAR_UNSIGNED__
+ if (!sb_rdonly(sb))
+ es->s_flags |=
+ cpu_to_le32(EXT2_FLAGS_UNSIGNED_HASH);
+ sbi->s_hash_unsigned = 3;
+#else
+ if (!sb_rdonly(sb))
+ es->s_flags |=
+ cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
+#endif
+ }
+ }
+}
+
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
{
struct ext4_super_block *es = NULL;
@@ -5197,26 +5226,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
- for (i = 0; i < 4; i++)
- sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
- sbi->s_def_hash_version = es->s_def_hash_version;
- if (ext4_has_feature_dir_index(sb)) {
- i = le32_to_cpu(es->s_flags);
- if (i & EXT2_FLAGS_UNSIGNED_HASH)
- sbi->s_hash_unsigned = 3;
- else if ((i & EXT2_FLAGS_SIGNED_HASH) == 0) {
-#ifdef __CHAR_UNSIGNED__
- if (!sb_rdonly(sb))
- es->s_flags |=
- cpu_to_le32(EXT2_FLAGS_UNSIGNED_HASH);
- sbi->s_hash_unsigned = 3;
-#else
- if (!sb_rdonly(sb))
- es->s_flags |=
- cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
-#endif
- }
- }
+ ext4_hash_info_init(sb);
if (ext4_handle_clustersize(sb))
goto failed_mount;
--
2.33.8
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Vasiliy Kovalev <kovalev@altlinux.org>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 1/3] ext4: factor out ext4_hash_info_init()
Date: Mon, 18 Nov 2024 23:36:31 -0500 [thread overview]
Message-ID: <20241118102050.16077-2-kovalev@altlinux.org> (raw)
Message-ID: <20241119043631.N0i6d6Mig_38jmpTAbWTVprfYFrp7qxQoWVJCl8yCIQ@z> (raw)
In-Reply-To: <20241118102050.16077-2-kovalev@altlinux.org>
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: db9345d9e6f075e1ec26afadf744078ead935fec
WARNING: Author mismatch between patch and upstream commit:
Backport author: Vasiliy Kovalev <kovalev@altlinux.org>
Commit author: Jason Yan <yanaijie@huawei.com>
Commit in newer trees:
|-----------------|----------------------------------------------|
| 6.11.y | Present (exact SHA1) |
|-----------------|----------------------------------------------|
Note: The patch differs from the upstream commit:
---
--- - 2024-11-18 17:26:48.895059440 -0500
+++ /tmp/tmp.VjhMY5d2bY 2024-11-18 17:26:48.887055706 -0500
@@ -1,18 +1,21 @@
+[ Upstream commit db9345d9e6f075e1ec26afadf744078ead935fec ]
+
Factor out ext4_hash_info_init() to simplify __ext4_fill_super(). No
functional change.
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20230323140517.1070239-2-yanaijie@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/super.c | 50 +++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 690faf766d23a..13c0345c53873 100644
+index 3bf214d4afef5..cf2c8cf507780 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -5024,6 +5024,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
+@@ -5042,6 +5042,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
@@ -48,7 +51,7 @@
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
{
struct ext4_super_block *es = NULL;
-@@ -5179,26 +5208,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
+@@ -5197,26 +5226,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
@@ -76,3 +79,6 @@
if (ext4_handle_clustersize(sb))
goto failed_mount;
+--
+2.33.8
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.11.y | Failed | N/A |
| stable/linux-6.6.y | Failed | N/A |
| stable/linux-6.1.y | Success | Success |
| stable/linux-5.15.y | Failed | N/A |
| stable/linux-5.10.y | Failed | N/A |
| stable/linux-5.4.y | Failed | N/A |
| stable/linux-4.19.y | Failed | N/A |
next prev parent reply other threads:[~2024-11-18 10:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 10:20 [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting Vasiliy Kovalev
2024-11-18 10:20 ` Vasiliy Kovalev [this message]
2024-11-19 4:36 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Sasha Levin
2024-11-18 10:20 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2024-11-18 10:20 ` [PATCH 3/3] ext4: fix error message when rejecting the default hash Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
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=20241118102050.16077-2-kovalev@altlinux.org \
--to=kovalev@altlinux.org \
--cc=dutyrok@altlinux.org \
--cc=gerben@altlinux.org \
--cc=gregkh@linuxfoundation.org \
--cc=lvc-project@linuxtesting.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.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