* [PATCH V5] ext4: check hash version and filesystem casefolded consistent [not found] <20240531185519.GB1153@sol.localdomain> @ 2024-06-01 11:37 ` Lizhi Xu 2024-06-03 14:50 ` Gabriel Krisman Bertazi 0 siblings, 1 reply; 10+ messages in thread From: Lizhi Xu @ 2024-06-01 11:37 UTC (permalink / raw) To: lkp Cc: coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-fscrypt, linux-kernel, lizhi.xu, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso, adilger.kernel, linux-ext4 When mounting the ext4 filesystem, if the hash version and casefolded are not consistent, exit the mounting. Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> --- fs/ext4/super.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c682fb927b64..0ad326504c50 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) goto failed_mount; ext4_hash_info_init(sb); + if (es->s_def_hash_version == DX_HASH_SIPHASH && + !ext4_has_feature_casefold(sb)) { + err = -EINVAL; + goto failed_mount; + } err = ext4_handle_clustersize(sb); if (err) -- 2.43.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH V5] ext4: check hash version and filesystem casefolded consistent 2024-06-01 11:37 ` [PATCH V5] ext4: check hash version and filesystem casefolded consistent Lizhi Xu @ 2024-06-03 14:50 ` Gabriel Krisman Bertazi 2024-06-04 1:17 ` Lizhi Xu 0 siblings, 1 reply; 10+ messages in thread From: Gabriel Krisman Bertazi @ 2024-06-03 14:50 UTC (permalink / raw) To: Lizhi Xu Cc: lkp, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-fscrypt, linux-kernel, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso, adilger.kernel, linux-ext4 Lizhi Xu <lizhi.xu@windriver.com> writes: > When mounting the ext4 filesystem, if the hash version and casefolded are not > consistent, exit the mounting. > > Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com > Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> > --- > fs/ext4/super.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index c682fb927b64..0ad326504c50 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) > goto failed_mount; > > ext4_hash_info_init(sb); > + if (es->s_def_hash_version == DX_HASH_SIPHASH && > + !ext4_has_feature_casefold(sb)) { Can we ever have DX_HASH_SIPHASH set up in the super block? I thought it was used solely for directories where ext4_hash_in_dirent(inode) is true. If this is only for the case of a superblock corruption, perhaps we should always reject the mount, whether casefold is enabled or not? -- Gabriel Krisman Bertazi ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V5] ext4: check hash version and filesystem casefolded consistent 2024-06-03 14:50 ` Gabriel Krisman Bertazi @ 2024-06-04 1:17 ` Lizhi Xu 2024-06-04 19:06 ` Gabriel Krisman Bertazi 0 siblings, 1 reply; 10+ messages in thread From: Lizhi Xu @ 2024-06-04 1:17 UTC (permalink / raw) To: krisman Cc: adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lizhi.xu, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso On Mon, 03 Jun 2024 10:50:51 -0400, Gabriel Krisman Bertazi wrote: > > When mounting the ext4 filesystem, if the hash version and casefolded are not > > consistent, exit the mounting. > > > > Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com > > Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> > > --- > > fs/ext4/super.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > > index c682fb927b64..0ad326504c50 100644 > > --- a/fs/ext4/super.c > > +++ b/fs/ext4/super.c > > @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) > > goto failed_mount; > > > > ext4_hash_info_init(sb); > > + if (es->s_def_hash_version == DX_HASH_SIPHASH && > > + !ext4_has_feature_casefold(sb)) { > > Can we ever have DX_HASH_SIPHASH set up in the super block? I thought > it was used solely for directories where ext4_hash_in_dirent(inode) is > true. The value of s'def_hash_version is obtained by reading the super block from the buffer cache of the block device in ext4_load_super(). > > If this is only for the case of a superblock corruption, perhaps we > should always reject the mount, whether casefold is enabled or not? Based on the existing information, it cannot be confirmed whether the superblock is corrupt, but one thing is clear: if the default hash version of the superblock is set to DX_HASH_SIPHASH, but the casefold feature is not set at the same time, it is definitely an error. Lizhi ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V5] ext4: check hash version and filesystem casefolded consistent 2024-06-04 1:17 ` Lizhi Xu @ 2024-06-04 19:06 ` Gabriel Krisman Bertazi 2024-06-05 1:16 ` Lizhi Xu ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Gabriel Krisman Bertazi @ 2024-06-04 19:06 UTC (permalink / raw) To: Lizhi Xu Cc: adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso Lizhi Xu <lizhi.xu@windriver.com> writes: > On Mon, 03 Jun 2024 10:50:51 -0400, Gabriel Krisman Bertazi wrote: >> > When mounting the ext4 filesystem, if the hash version and casefolded are not >> > consistent, exit the mounting. >> > >> > Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com >> > Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> >> > --- >> > fs/ext4/super.c | 5 +++++ >> > 1 file changed, 5 insertions(+) >> > >> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c >> > index c682fb927b64..0ad326504c50 100644 >> > --- a/fs/ext4/super.c >> > +++ b/fs/ext4/super.c >> > @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) >> > goto failed_mount; >> > >> > ext4_hash_info_init(sb); >> > + if (es->s_def_hash_version == DX_HASH_SIPHASH && >> > + !ext4_has_feature_casefold(sb)) { >> >> Can we ever have DX_HASH_SIPHASH set up in the super block? I thought >> it was used solely for directories where ext4_hash_in_dirent(inode) is >> true. > The value of s'def_hash_version is obtained by reading the super block from the > buffer cache of the block device in ext4_load_super(). Yes, I know. My point is whether this check should just be: if (es->s_def_hash_version == DX_HASH_SIPHASH) goto failed_mount; Since, IIUC, DX_HASH_SIPHASH is done per-directory and not written to the sb. >> If this is only for the case of a superblock corruption, perhaps we >> should always reject the mount, whether casefold is enabled or not? > Based on the existing information, it cannot be confirmed whether the superblock > is corrupt, but one thing is clear: if the default hash version of the superblock > is set to DX_HASH_SIPHASH, but the casefold feature is not set at the same time, > it is definitely an error. -- Gabriel Krisman Bertazi ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V5] ext4: check hash version and filesystem casefolded consistent 2024-06-04 19:06 ` Gabriel Krisman Bertazi @ 2024-06-05 1:16 ` Lizhi Xu 2024-06-05 1:23 ` [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash Lizhi Xu 2024-06-06 6:27 ` [PATCH V5] ext4: check hash version and filesystem casefolded consistent Eric Biggers 2 siblings, 0 replies; 10+ messages in thread From: Lizhi Xu @ 2024-06-05 1:16 UTC (permalink / raw) To: krisman Cc: adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lizhi.xu, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso On Tue, 04 Jun 2024 15:06:32 -0400, Gabriel Krisman Bertazi wrote: > >> > When mounting the ext4 filesystem, if the hash version and casefolded are not > >> > consistent, exit the mounting. > >> > > >> > Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com > >> > Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> > >> > --- > >> > fs/ext4/super.c | 5 +++++ > >> > 1 file changed, 5 insertions(+) > >> > > >> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > >> > index c682fb927b64..0ad326504c50 100644 > >> > --- a/fs/ext4/super.c > >> > +++ b/fs/ext4/super.c > >> > @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) > >> > goto failed_mount; > >> > > >> > ext4_hash_info_init(sb); > >> > + if (es->s_def_hash_version == DX_HASH_SIPHASH && > >> > + !ext4_has_feature_casefold(sb)) { > >> > >> Can we ever have DX_HASH_SIPHASH set up in the super block? I thought > >> it was used solely for directories where ext4_hash_in_dirent(inode) is > >> true. > > The value of s'def_hash_version is obtained by reading the super block from the > > buffer cache of the block device in ext4_load_super(). > > Yes, I know. My point is whether this check should just be: Based on the existing information, it cannot be confirmed that it is incorrect to separately determine the value of s_def_hash_version as DX_HASH_SIPHASH. Additionally, I have come up with a better solution, and I will issue the next fixed version in a while. > > if (es->s_def_hash_version == DX_HASH_SIPHASH) > goto failed_mount; > > Since, IIUC, DX_HASH_SIPHASH is done per-directory and not written to > the sb. > > >> If this is only for the case of a superblock corruption, perhaps we > >> should always reject the mount, whether casefold is enabled or not? > > Based on the existing information, it cannot be confirmed whether the superblock > > is corrupt, but one thing is clear: if the default hash version of the superblock > > is set to DX_HASH_SIPHASH, but the casefold feature is not set at the same time, > > it is definitely an error. Lizhi ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash 2024-06-04 19:06 ` Gabriel Krisman Bertazi 2024-06-05 1:16 ` Lizhi Xu @ 2024-06-05 1:23 ` Lizhi Xu 2024-08-22 15:00 ` Theodore Ts'o 2024-06-06 6:27 ` [PATCH V5] ext4: check hash version and filesystem casefolded consistent Eric Biggers 2 siblings, 1 reply; 10+ messages in thread From: Lizhi Xu @ 2024-06-05 1:23 UTC (permalink / raw) To: krisman Cc: adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lizhi.xu, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso When mounting the ext4 filesystem, if the default hash version is set to DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> --- fs/ext4/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c682fb927b64..d0645af3e66e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3593,6 +3593,14 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly) "mounted without CONFIG_UNICODE"); return 0; } +#else + if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH && + !ext4_has_feature_casefold(sb)) { + ext4_msg(sb, KERN_ERR, + "Filesystem without casefold feature cannot be " + "mounted with spihash"); + return 0; + } #endif if (readonly) -- 2.43.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash 2024-06-05 1:23 ` [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash Lizhi Xu @ 2024-08-22 15:00 ` Theodore Ts'o 2024-08-27 20:16 ` [PATCH] ext4: Fix error message when rejecting the default hash Gabriel Krisman Bertazi 0 siblings, 1 reply; 10+ messages in thread From: Theodore Ts'o @ 2024-08-22 15:00 UTC (permalink / raw) To: krisman, Lizhi Xu Cc: Theodore Ts'o, adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs On Wed, 05 Jun 2024 09:23:35 +0800, Lizhi Xu wrote: > When mounting the ext4 filesystem, if the default hash version is set to > DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. > > Applied, thanks! [1/1] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash commit: 985b67cd86392310d9e9326de941c22fc9340eec Best regards, -- Theodore Ts'o <tytso@mit.edu> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] ext4: Fix error message when rejecting the default hash 2024-08-22 15:00 ` Theodore Ts'o @ 2024-08-27 20:16 ` Gabriel Krisman Bertazi 2024-09-05 14:53 ` Theodore Ts'o 0 siblings, 1 reply; 10+ messages in thread From: Gabriel Krisman Bertazi @ 2024-08-27 20:16 UTC (permalink / raw) To: Theodore Ts'o Cc: Lizhi Xu, adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs "Theodore Ts'o" <tytso@mit.edu> writes: > On Wed, 05 Jun 2024 09:23:35 +0800, Lizhi Xu wrote: >> When mounting the ext4 filesystem, if the default hash version is set to >> DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. >> >> > > Applied, thanks! > > [1/1] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash > commit: 985b67cd86392310d9e9326de941c22fc9340eec Ted, Since you took the above, can you please consider the following fixup? I had pointed we shouldn't have siphash as the sb default hash at all: based on your dev branch. >8 Subject: [PATCH] ext4: Fix error message when rejecting the default hash Commit 985b67cd8639 ("ext4: filesystems without casefold feature cannot be mounted with siphash") properly rejects volumes where s_def_hash_version is set to DX_HASH_SIPHASH, but the check and the error message should not look into casefold setup - a filesystem should never have DX_HASH_SIPHASH as the default hash. Fix it and, since we are there, move the check to ext4_hash_info_init. Fixes:985b67cd8639 ("ext4: filesystems without casefold feature cannot be mounted with siphash") Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de> --- fs/ext4/ext4.h | 1 + fs/ext4/super.c | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 5845e4aa091a..4120f24880cb 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2462,6 +2462,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize) #define DX_HASH_HALF_MD4_UNSIGNED 4 #define DX_HASH_TEA_UNSIGNED 5 #define DX_HASH_SIPHASH 6 +#define DX_HASH_LAST DX_HASH_SIPHASH static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc, const void *address, unsigned int length) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 25cd0d662e31..c6a34ad07ecc 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3582,13 +3582,6 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly) "mounted without CONFIG_UNICODE"); return 0; } - if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH && - !ext4_has_feature_casefold(sb)) { - ext4_msg(sb, KERN_ERR, - "Filesystem without casefold feature cannot be " - "mounted with siphash"); - return 0; - } if (readonly) return 1; @@ -5094,16 +5087,27 @@ 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) +static int 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; + sbi->s_def_hash_version = es->s_def_hash_version; + + if (sbi->s_def_hash_version > DX_HASH_LAST) { + ext4_msg(sb, KERN_ERR, + "Invalid default hash set in the superblock"); + return -EINVAL; + } else if (sbi->s_def_hash_version == DX_HASH_SIPHASH) { + ext4_msg(sb, KERN_ERR, + "SIPHASH is not a valid default hash value"); + return -EINVAL; + } + 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) @@ -5121,6 +5125,7 @@ static void ext4_hash_info_init(struct super_block *sb) #endif } } + return 0; } static int ext4_block_group_meta_init(struct super_block *sb, int silent) @@ -5256,7 +5261,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) if (err) goto failed_mount; - ext4_hash_info_init(sb); + err = ext4_hash_info_init(sb); + if (err) + goto failed_mount; err = ext4_handle_clustersize(sb); if (err) -- 2.46.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] ext4: Fix error message when rejecting the default hash 2024-08-27 20:16 ` [PATCH] ext4: Fix error message when rejecting the default hash Gabriel Krisman Bertazi @ 2024-09-05 14:53 ` Theodore Ts'o 0 siblings, 0 replies; 10+ messages in thread From: Theodore Ts'o @ 2024-09-05 14:53 UTC (permalink / raw) To: Gabriel Krisman Bertazi Cc: Theodore Ts'o, Lizhi Xu, adilger.kernel, coreteam, davem, ebiggers, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs On Tue, 27 Aug 2024 16:16:36 -0400, Gabriel Krisman Bertazi wrote: > "Theodore Ts'o" <tytso@mit.edu> writes: > > > On Wed, 05 Jun 2024 09:23:35 +0800, Lizhi Xu wrote: > >> When mounting the ext4 filesystem, if the default hash version is set to > >> DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. > >> > >> > > > > Applied, thanks! > > > > [1/1] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash > > commit: 985b67cd86392310d9e9326de941c22fc9340eec > > [...] Applied, thanks! [1/1] ext4: Fix error message when rejecting the default hash commit: a2187431c395cdfbf144e3536f25468c64fc7cfa Best regards, -- Theodore Ts'o <tytso@mit.edu> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V5] ext4: check hash version and filesystem casefolded consistent 2024-06-04 19:06 ` Gabriel Krisman Bertazi 2024-06-05 1:16 ` Lizhi Xu 2024-06-05 1:23 ` [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash Lizhi Xu @ 2024-06-06 6:27 ` Eric Biggers 2 siblings, 0 replies; 10+ messages in thread From: Eric Biggers @ 2024-06-06 6:27 UTC (permalink / raw) To: Gabriel Krisman Bertazi Cc: Lizhi Xu, adilger.kernel, coreteam, davem, fw, jaegeuk, kadlec, kuba, linux-ext4, linux-fscrypt, linux-kernel, lkp, llvm, netdev, netfilter-devel, oe-kbuild-all, pablo, syzbot+340581ba9dceb7e06fb3, syzkaller-bugs, tytso On Tue, Jun 04, 2024 at 03:06:32PM -0400, Gabriel Krisman Bertazi wrote: > Lizhi Xu <lizhi.xu@windriver.com> writes: > > > On Mon, 03 Jun 2024 10:50:51 -0400, Gabriel Krisman Bertazi wrote: > >> > When mounting the ext4 filesystem, if the hash version and casefolded are not > >> > consistent, exit the mounting. > >> > > >> > Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com > >> > Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> > >> > --- > >> > fs/ext4/super.c | 5 +++++ > >> > 1 file changed, 5 insertions(+) > >> > > >> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > >> > index c682fb927b64..0ad326504c50 100644 > >> > --- a/fs/ext4/super.c > >> > +++ b/fs/ext4/super.c > >> > @@ -5262,6 +5262,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) > >> > goto failed_mount; > >> > > >> > ext4_hash_info_init(sb); > >> > + if (es->s_def_hash_version == DX_HASH_SIPHASH && > >> > + !ext4_has_feature_casefold(sb)) { > >> > >> Can we ever have DX_HASH_SIPHASH set up in the super block? I thought > >> it was used solely for directories where ext4_hash_in_dirent(inode) is > >> true. > > The value of s'def_hash_version is obtained by reading the super block from the > > buffer cache of the block device in ext4_load_super(). > > Yes, I know. My point is whether this check should just be: > > if (es->s_def_hash_version == DX_HASH_SIPHASH) > goto failed_mount; > > Since, IIUC, DX_HASH_SIPHASH is done per-directory and not written to > the sb. > That seems right to me. SipHash can never be the default because it's only used on directories that are both encrypted and casefolded. - Eric ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-09-05 14:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240531185519.GB1153@sol.localdomain>
2024-06-01 11:37 ` [PATCH V5] ext4: check hash version and filesystem casefolded consistent Lizhi Xu
2024-06-03 14:50 ` Gabriel Krisman Bertazi
2024-06-04 1:17 ` Lizhi Xu
2024-06-04 19:06 ` Gabriel Krisman Bertazi
2024-06-05 1:16 ` Lizhi Xu
2024-06-05 1:23 ` [PATCH V6] fs/ext4: Filesystem without casefold feature cannot be mounted with spihash Lizhi Xu
2024-08-22 15:00 ` Theodore Ts'o
2024-08-27 20:16 ` [PATCH] ext4: Fix error message when rejecting the default hash Gabriel Krisman Bertazi
2024-09-05 14:53 ` Theodore Ts'o
2024-06-06 6:27 ` [PATCH V5] ext4: check hash version and filesystem casefolded consistent Eric Biggers
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox