| add Commit Message Signed-off-by: zhangzhiwi <weizhi.zhang@huawei.com> | 2 年前 |
| docs: 精简优化知识库文档与项目指引 精简 docs/knowledge/ 下 13 个知识文档和 AGENTS.md,去除冗余内容,保留关键信息便于快速查阅。 Fixes #2328 Co-Authored-By: Agent Signed-off-by: Clone_Zhang <zhangjunjie56@huawei.com> | 11 天前 |
| del unused img Signed-off-by: xiechang2@huawei.com <root@DESKTOP-QGVT3BA.localdomain> | 4 年前 |
| fix: replace DelayedSingleton with Meyer's singleton for StorageManagerConnect/CjStorageStatusService and clean up DelayedSingleton uses new(std::nothrow) which can return nullptr on OOM, causing crashes when callers dereference without checks. Meyer's singleton (static local reference) is C++11 thread-safe and never null. StorageManagerConnect: 44 arrow->dot replacements in kits_impl, 34 nullptr check blocks removed in taihe, SmDeathRecipient::OnRemoteDied fixed. CjStorageStatusService: 3 nullptr check blocks removed, CjSmDeathRecipient ::OnRemoteDied fixed. Move constructor and destructor to private for all three singleton classes to prevent external instantiation. Remove CreateForTesting/SetInstanceForTesting/GetInstanceForTesting/ ResetInstanceForTesting and instance_ptr_for_testing_ from StorageDaemonCommunication - testing utilities should not exist in business code. Update test files to use GetInstance() reference and ResetSdProxy(), following VolumeManagerService test pattern. Wrap over-120-char lines for cleancode compliance by extracting GetInstance() into local auto& reference. Co-Authored-By: Agent Signed-off-by: gzhuangzhuang <gengzhuangzhuang@huawei.com> Change-Id: I6954bebad07cf3cc0b2f5ee6066d1743eb87f755 | 7 天前 |
| fix:code Signed-off-by: 2301_76815458 <zhouaoteng@h-partners.com> | 12 小时前 |
| !2940 merge feat/metadata-split-to-free-and-system into master feat: HMFS metadata按比例拆分到freeSize和systemDataSize Created-by: dyylll Commit-by: dyylll;Dyylll Merged-by: openharmony_ci Description: **Description:** 将HMFS文件系统metadata按比例拆分到freeSize和systemDataSize,使存储空间显示更准确。 主要修改: - 将metadata计算从storage_daemon迁移到storage_manager,复用已有GetDataSizeByPath IPC - 新增StorageStatusManager::GetMetaDataSize,读取HMFS sysfs文件计算metadata大小 - 新增StorageTotalStatusService::GetDataTotalSize,获取/data分区总大小 - 修改GetFreeSize,按比例计算freeMetadata并累加,含降级保护 - 修改GetSystemDataSize,按比例计算usedMetadata并累加,含降级保护 - GetMetaDataSize包含乘法溢出和加法溢出检查 - 新增14个UT测试用例,覆盖所有分支(含正常路径和降级路径) **Issue number:** Fixes #2327 **Test & Result:** - 编译验证:hb build storage_service -i 成功,hb build storage_service -t 成功(677/677 targets) - 设备UT验证:RK3568开发板上执行,storage_status_manager_test 32/32 PASSED,storage_total_status_service_test 20/20 PASSED - 降级验证:Linux无HMFS环境下GetFreeSize正确降级返回statvfs原始值 **CodeCheck:** <table> <tr> <th>类型</th><th>自检项</th><th>自检结果</th> </tr> <tr> <td rowspan="2">多线程相关</td><td>在类的成员变量中定义了vector/map/list等容器类型,且在多个成员函数中有操作时,需要加锁保护</td><td>自检结果:不涉及,无共享可变状态</td> </tr> <tr> <td>定义全局变量,在多个函数中都有操作时,需要加锁保护</td><td>自检结果:不涉及</td> </tr> <tr> <td rowspan="4">内存相关</td><td>调用外部接口时,确认是否对返回值做了判断,尤其外部接口返回了nullptr的情况,避免进程崩溃</td><td>自检结果:已检查sdCommunication nullptr、IPC返回值</td> </tr> <tr> <td>调用安全函数时,如memcpy_s等,是否检查其返回值</td><td>自检结果:不涉及</td> </tr> <tr> <td>检查函数中是否涉及了内存或资源申请,注意每个异常退出流程是否已释放</td><td>自检结果:不涉及动态内存申请</td> </tr> <tr> <td>隐式内存分配场景:realpath、ReadParcelable序列化、cJSON相关函数时等</td><td>自检结果:不涉及</td> </tr> <tr> <td rowspan="4">校验外部输入</td><td>使用nlohmann:json解析外部输入时,需判断参数类型是否符合预期</td><td>自检结果:不涉及</td> </tr> <tr> <td>所有外部输入均不可信,需判断外部输入是否直接作为内存分配的大小等</td><td>自检结果:IPC返回值已做负值和溢出校验</td> </tr> <tr> <td>外部输入的路径不可信,需使用realpath做标准化处理</td><td>自检结果:路径为代码内硬编码常量,非外部输入</td> </tr> <tr> <td>外部输入包括IPC的proxy/stub接口等</td><td>自检结果:IPC返回值已做ret != E_OK校验</td> </tr> <tr> <td rowspan="2">数学运算</td><td>代码中是否混合了加减乘除等运算,需检查是否可能导致整数溢出或符号翻转</td><td>自检结果:已添加乘法溢出检查和加法溢出检查</td> </tr> <tr> <td>需检查代码是否有高精度数字转换为低精度的操作</td><td>自检结果:double转int64_t已做边界钳位</td> </tr> <tr> <td rowspan="1">秘钥相关</td><td>如变量临时保存了口令、秘钥等,需要在使用完成后及时清空</td><td>自检结果:不涉及</td> </tr> <tr> <td rowspan="2">权限相关</td><td>对外提供接口是否做了权限保护和校验</td><td>自检结果:不涉及新增接口</td> </tr> <tr> <td>内核对外提供了设备节点是否做了权限保护</td><td>自检结果:不涉及</td> </tr> <tr> <td rowspan="3">内核操作</td><td>是否有mmap操作及remap_pfn_range地址映射校验</td><td>自检结果:不涉及</td> </tr> <tr> <td>是否有copy_from_user并做长度校验</td><td>自检结果:不涉及</td> </tr> <tr> <td>是否有copy_to_user并做完整初始化</td><td>自检结果:不涉及</td> </tr> </table> See merge request: openharmony/filemanagement_storage_service!2940 | 8 天前 |
| 空间统计claw支持--help命令及模拟器问题 Signed-off-by: daiyunlong <daiyunlong4@huawei.com> Co-Authored-By: Agent | 1 个月前 |
| static code check fix Signed-off-by: xianghengliang <xianghengliang1@huawei.com> | 4 年前 |
| fix build warning Signed-off-by:gudehe<gudehe@huawei.com> | 4 年前 |
| docs: 精简优化知识库文档与项目指引 精简 docs/knowledge/ 下 13 个知识文档和 AGENTS.md,去除冗余内容,保留关键信息便于快速查阅。 Fixes #2328 Co-Authored-By: Agent Signed-off-by: Clone_Zhang <zhangjunjie56@huawei.com> | 11 天前 |
| 注销用户AB类密钥未logout Signed-off-by: dengrenqi <1069093439@qq.com> | 1 年前 |
| fix issue Signed-off-by: 张文迪 <zhangwendi3@huawei.com> | 4 年前 |
| 回退 'Pull Request !496 : 回退 'Pull Request !493 : add sysparam dac'' | 3 年前 |
| change readme file name Signed-off-by: jiahaoluo <luojiahao5@huawei.com> | 4 年前 |
| Reduce differences Signed-off-by: Clone_Zhang <zhangjunjie56@huawei.com> | 11 个月前 |
| 磁盘需求第五笔代码 Signed-off-by: sunxiaoqianghappy <sunxiaoqiang7@h-partners.com> Co-authored-by: Agent Signed-off-by: sunxiaoqianghappy <sunxiaoqiang7@h-partners.com> | 26 天前 |
| 修改日期 Signed-off-by: liuxiaowei <liuxiaowei45@huawei.com> | 2 年前 |
| Storage:修改雷达打点 Signed-off-by: zhaoshuyuan <zhaoshuyuan2@huawei.com> | 1 年前 |
| 车机强标需求,外卡不可执行 Signed-off-by: chenkang_jeff <chenkang45@huawei.com> Change-Id: I369d9c9656c56abfc5b2f2fc9176fd1a13560d73 | 20 天前 |