Projects
Mega:23.09
e2fsprogs
_service:tar_scm:0004-e2fsck-add-env-param-E2FS...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0004-e2fsck-add-env-param-E2FS_UNRELIABLE_IO-to-fi.patch of Package e2fsprogs
From 491c2dea43a9c9f33c5feb9ccd9b91d04a24b6f7 Mon Sep 17 00:00:00 2001 From: Haotian <lihaotian9@huawei.com> Date: Wed, 17 Mar 2021 17:34:14 +0800 Subject: [PATCH] e2fsck: add env param E2FS_UNRELIABLE_IO to fix unreliable io case Func write_primary_superblock() has two way to wirte disk. One is 1k block, the other is byte by byte as default. On unreliable IO case such as flaky network, the byte-by-byte method may lost some data of ext4-superblock. Then, the superblock may lose consistency and the sb checksum error will occur. We provide the env param E2FS_UNRELIABLE_IO for users to choose if it's necessary to take 1k block way on writing disk. Fix issue:https://gitee.com/src-openeuler/e2fsprogs/issues/I4RZVX?from=project-issue Signed-off-by: Haotian Li <lihaotian9@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> --- lib/ext2fs/closefs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c index 1d4d5b7..1893fb6 100644 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@ -195,8 +195,9 @@ static errcode_t write_primary_superblock(ext2_filsys fs, __u16 *old_super, *new_super; int check_idx, write_idx, size; errcode_t retval; + int is_unreliable_io = getenv("E2FS_UNRELIABLE_IO") ? 1 : 0; - if (!fs->io->manager->write_byte || !fs->orig_super) { + if (!fs->io->manager->write_byte || !fs->orig_super || is_unreliable_io) { fallback: io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET); retval = io_channel_write_blk64(fs->io, 1, -SUPERBLOCK_SIZE, -- 2.21.1 (Apple Git-122.3)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2