diff options
| author | Heming Zhao <heming.zhao@suse.com> | 2025-01-21 19:22:03 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-17 11:36:52 +0100 |
| commit | e88afb1d051c608759e05dcd72f46c3dfde57041 (patch) | |
| tree | 787c9a4c6568d45e1ff909d8f628fc57b797caef /fs | |
| parent | 2d5097731bc898661cd1d0641f167eef6232976a (diff) | |
| download | linux-e88afb1d051c608759e05dcd72f46c3dfde57041.tar.gz linux-e88afb1d051c608759e05dcd72f46c3dfde57041.tar.bz2 linux-e88afb1d051c608759e05dcd72f46c3dfde57041.zip | |
ocfs2: fix incorrect CPU endianness conversion causing mount failure
commit f921da2c34692dfec5f72b5ae347b1bea22bb369 upstream.
Commit 23aab037106d ("ocfs2: fix UBSAN warning in ocfs2_verify_volume()")
introduced a regression bug. The blksz_bits value is already converted to
CPU endian in the previous code; therefore, the code shouldn't use
le32_to_cpu() anymore.
Link: https://lkml.kernel.org/r/20250121112204.12834-1-heming.zhao@suse.com
Fixes: 23aab037106d ("ocfs2: fix UBSAN warning in ocfs2_verify_volume()")
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ocfs2/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c79b4291777f..1e87554f6f41 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -2340,7 +2340,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di, mlog(ML_ERROR, "found superblock with incorrect block " "size bits: found %u, should be 9, 10, 11, or 12\n", blksz_bits); - } else if ((1 << le32_to_cpu(blksz_bits)) != blksz) { + } else if ((1 << blksz_bits) != blksz) { mlog(ML_ERROR, "found superblock with incorrect block " "size: found %u, should be %u\n", 1 << blksz_bits, blksz); } else if (le16_to_cpu(di->id2.i_super.s_major_rev_level) != |
