15 Star 3 Fork 69

src-openEuler/util-linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-revert-libblkid-ext-add-checksum-support.patch 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
From f991ef78af15a001c4acfcb42abca9ce3dce8fbe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sat, 5 Nov 2022 02:21:27 +0100
Subject: [PATCH] revert libblkid ext add checksum support
---
libblkid/src/superblocks/ext.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/libblkid/src/superblocks/ext.c b/libblkid/src/superblocks/ext.c
index 885fec2..1c79942 100644
--- a/libblkid/src/superblocks/ext.c
+++ b/libblkid/src/superblocks/ext.c
@@ -19,7 +19,6 @@
#include <time.h>
#include "superblocks.h"
-#include "crc32c.h"
struct ext2_super_block {
uint32_t s_inodes_count;
@@ -75,8 +74,7 @@ struct ext2_super_block {
uint16_t s_mmp_interval;
uint64_t s_mmp_block;
uint32_t s_raid_stripe_width;
- uint32_t s_reserved[162];
- uint32_t s_checksum;
+ uint32_t s_reserved[163];
} __attribute__((packed));
/* magic string */
@@ -104,7 +102,6 @@ struct ext2_super_block {
#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
-#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400
/* for s_feature_incompat */
#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -151,14 +148,9 @@ static struct ext2_super_block *ext_get_super(
struct ext2_super_block *es;
es = (struct ext2_super_block *)
- blkid_probe_get_buffer(pr, EXT_SB_OFF, sizeof(struct ext2_super_block));
+ blkid_probe_get_buffer(pr, EXT_SB_OFF, 0x200);
if (!es)
return NULL;
- if (le32_to_cpu(es->s_feature_ro_compat) & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) {
- uint32_t csum = crc32c(~0, es, offsetof(struct ext2_super_block, s_checksum));
- if (!blkid_probe_verify_csum(pr, csum, le32_to_cpu(es->s_checksum)))
- return NULL;
- }
if (fc)
*fc = le32_to_cpu(es->s_feature_compat);
if (fi)
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/util-linux.git
git@gitee.com:src-openeuler/util-linux.git
src-openeuler
util-linux
util-linux
master

搜索帮助