6 Star 5 Fork 55

OpenHarmony/third_party_e2fsprogs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
0021-tune2fs-exit-directly-when-fs-freed-in-ext2fs_run_ext3_journal.patch 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
f房芷仪 提交于 2024-04-08 10:31 . e2fsprogs升级
From 47ab1faccb228e10869898c8a02b06f5a91a9174 Mon Sep 17 00:00:00 2001
From: Li Jinlin <lijinlin3@huawei.com>
Date: Fri, 16 Sep 2022 15:42:23 +0800
Subject: tune2fs: exit directly when fs freed in ext2fs_run_ext3_journal
In ext2fs_run_ext3_journal(), fs will be freed and reallocated.
However, the reallocation by ext2fs_open() may fail in some cases ---
for example, when the device becomes offline. To avoid a segfault,
exit if fs is NULL.
[ Simplified the patch by by simply exiting if fs is NULL -TYT ]
Signed-off-by: Li Jinlin <lijinlin3@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
misc/tune2fs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index bed3d95b..f566ed81 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -3106,6 +3106,8 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
com_err("tune2fs", retval,
"while recovering journal.\n");
printf(_("Please run e2fsck -fy %s.\n"), argv[1]);
+ if (!fs)
+ exit(1);
rc = 1;
goto closefs;
}
--
cgit
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/third_party_e2fsprogs.git
git@gitee.com:openharmony/third_party_e2fsprogs.git
openharmony
third_party_e2fsprogs
third_party_e2fsprogs
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385