1 Star 0 Fork 25

池鱼/util-linux

forked from src-anolis-os/util-linux 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0076-libblkid-fix-Atari-prober-logic.patch 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2023-01-30 16:56 . update to util-linux-2.32.1-39.el8_7
From 214eaa70d8431161de03ea7903f814c102e87919 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Fri, 9 Oct 2020 13:06:08 +0200
Subject: libblkid: fix Atari prober logic
Addresses: https://github.com/karelzak/util-linux/issues/1159
Addresses: https://github.com/karelzak/util-linux/issues/1116
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2060030
Upstream: http://github.com/util-linux/util-linux/commit/282ceadc3a72fc07dd0388b8880fd751490bb87f
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/partitions/atari.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/libblkid/src/partitions/atari.c b/libblkid/src/partitions/atari.c
index 1224a577c..b469ef5a1 100644
--- a/libblkid/src/partitions/atari.c
+++ b/libblkid/src/partitions/atari.c
@@ -199,11 +199,10 @@ static int probe_atari_pt(blkid_probe pr,
hdsize = blkid_probe_get_size(pr) / 512;
- /* Look for validly looking primary partition */
- for (i = 0; ; i++) {
- if (i >= ARRAY_SIZE(rs->part))
- goto nothing;
-
+ /*
+ * At least one valid partition required
+ */
+ for (i = 0; i < 4; i++) {
if (IS_PARTDEF_VALID(rs->part[i], hdsize)) {
blkid_probe_set_magic(pr,
offsetof(struct atari_rootsector, part[i]),
@@ -213,6 +212,9 @@ static int probe_atari_pt(blkid_probe pr,
}
}
+ if (i == 4)
+ goto nothing;
+
if (blkid_partitions_need_typeonly(pr))
/* caller does not ask for details about partitions */
return BLKID_PROBE_OK;
--
2.36.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxy19951122/util-linux.git
git@gitee.com:zxy19951122/util-linux.git
zxy19951122
util-linux
util-linux
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385