未验证 提交 77bce3a3 编写于 作者: O openharmony_ci 提交者: Gitee

!1346 nofail挑单OpenHarmony-3.2-Beta3

Merge pull request !1346 from cheng_jinsong/cherry-pick-1665214246
......@@ -50,6 +50,7 @@ static unsigned int ConvertFlags(char *flagBuffer)
{"check", FS_MANAGER_CHECK},
{"wait", FS_MANAGER_WAIT},
{"required", FS_MANAGER_REQUIRED},
{"nofail", FS_MANAGER_NOFAIL},
};
BEGET_CHECK_RETURN_VALUE(flagBuffer != NULL && *flagBuffer != '\0', 0); // No valid flags.
......
......@@ -406,7 +406,12 @@ int MountOneItem(FstabItem *item)
int rc = Mount(item->deviceName, item->mountPoint, item->fsType, mountFlags, fsSpecificData);
if (rc != 0) {
BEGET_LOGE("Mount %s to %s failed %d", item->deviceName, item->mountPoint, errno);
if (FM_MANAGER_NOFAIL_ENABLED(item->fsManagerFlags)) {
BEGET_LOGE("Mount no fail device %s to %s failed, err = %d", item->deviceName, item->mountPoint, errno);
} else {
BEGET_LOGW("Mount %s to %s failed, err = %d. Ignore failure", item->deviceName, item->mountPoint, errno);
rc = 0;
}
} else {
BEGET_LOGI("Mount %s to %s successful", item->deviceName, item->mountPoint);
}
......
......@@ -29,6 +29,7 @@ extern "C" {
#define FS_MANAGER_CHECK 0x00000001
#define FS_MANAGER_WAIT 0x00000002
#define FS_MANAGER_REQUIRED 0x00000004
#define FS_MANAGER_NOFAIL 0x00000008
#define NAME_SIZE 32
#define MAX_SLOT 2
......@@ -38,6 +39,7 @@ extern "C" {
#define FM_MANAGER_CHECK_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), CHECK)
#define FM_MANAGER_WAIT_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), WAIT)
#define FM_MANAGER_REQUIRED_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), REQUIRED)
#define FM_MANAGER_NOFAIL_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), NOFAIL)
typedef enum MountStatus {
MOUNT_ERROR = -1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册