| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
optimize mount again https://gitcode.com/openharmony/filemanagement_storage_service/issues/2330 Co-Authored-By: Agent Signed-off-by: hunili <lihucheng2@h-partners.com> | 11 天前 | |
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 | 9 天前 | |
检视意见修改 Signed-off-by: sunxiaoqianghappy <sunxiaoqiang7@h-partners.com> | 4 个月前 | |
增加克隆事件的侦听条件 Signed-off-by: libo429 <libo429@h-partners.com> | 3 天前 | |
fix: replace StorageDaemonCommunication DelayedSingleton with Meyer's singleton Change DECLARE_DELAYED_SINGLETON to static local variable GetInstance pattern, eliminating nullptr risk when memory is exhausted. Remove all nullptr checks on sdCommunication since reference is never null. Update all call sites from shared_ptr pattern to reference pattern. Co-Authored-By: Agent Signed-off-by: gzhuangzhuang <gengzhuangzhuang@huawei.com> Change-Id: I01bbfb85f27aa53c8a4e8b128bbd7bb1d2f6201e | 9 天前 | |
fix: replace StorageDaemonCommunication DelayedSingleton with Meyer's singleton Change DECLARE_DELAYED_SINGLETON to static local variable GetInstance pattern, eliminating nullptr risk when memory is exhausted. Remove all nullptr checks on sdCommunication since reference is never null. Update all call sites from shared_ptr pattern to reference pattern. Co-Authored-By: Agent Signed-off-by: gzhuangzhuang <gengzhuangzhuang@huawei.com> Change-Id: I01bbfb85f27aa53c8a4e8b128bbd7bb1d2f6201e | 9 天前 | |
!2935 merge fix/storage-daemon-communication-singleton-nullpointer into master fix: DelayedSingleton空指针风险整改(StorageDaemonCommunication/StorageManagerConnect/CjStorageStatusService) Created-by: gzhuangzhuang Commit-by: gzhuangzhuang Merged-by: openharmony_ci Description: **Description:** 将3个类的DelayedSingleton(shared_ptr, 内存耗尽时可能返回nullptr, 调用方未检查会导致崩溃)改为Meyer's singleton(static局部变量引用, C++11线程安全, 永远不为null)。 核心变更: 1. StorageDaemonCommunication: 移除DECLARE_DELAYED_SINGLETON,改为static T& GetInstance()返回引用;所有调用方从GetInstance()->改为GetInstance().;移除nullptr检查 2. StorageManagerConnect: 同上模式;44处kits_impl箭头->改为点.;34处taihe nullptr检查块移除;SmDeathRecipient::OnRemoteDied在内存压力最大的death回调中不再有空指针风险 3. CjStorageStatusService: 同上模式;3处nullptr检查块移除;CjSmDeathRecipient::OnRemoteDied不再有空指针风险 受影响文件25个(生产代码22个+测试文件3个),净减少约400行代码。 **Issue number:** https://gitcode.com/openharmony/filemanagement_storage_service/issues/2345 **Test & Result:** hb build storage_service -i 编译通过 hb build storage_service -t UT编译通过(592个目标全部成功) **CodeCheck:** <table> <tr> <th>类型</th><th>自检项</th><th>自检结果</th> </tr> <tr> <td rowspan="2">多线程相关</td><td>在类的成员变量中定义了容器类型,且在多个成员函数中有操作时,需要加锁保护</td><td>不涉及,原有mutex_保持不变</td> </tr> <tr> <td>定义全局变量,在多个函数中都有操作时,需要加锁保护</td><td>不涉及</td> </tr> <tr> <td rowspan="4">内存相关</td><td>调用外部接口时,确认是否对返回值做了判断,尤其外部接口返回了nullptr的情况</td><td>本PR正是修复此类问题,从可能nullptr改为永远不为null的引用</td> </tr> <tr> <td>调用安全函数时,检查返回值</td><td>不涉及</td> </tr> <tr> <td>检查函数中是否涉及了内存或资源申请,异常退出流程是否释放资源</td><td>Meyer's singleton无需手动new/delete,无内存泄漏风险</td> </tr> <tr> <td>隐式内存分配场景需主动释放或使用智能指针</td><td>static局部变量由C++ runtime管理,无隐式分配</td> </tr> <tr> <td rowspan="4">校验外部输入</td><td>使用nlohmann:json解析外部输入时,需判断参数类型</td><td>不涉及</td> </tr> <tr> <td>外部输入不可信,需判断</td><td>不涉及</td> </tr> <tr> <td>外部输入路径不可信,需使用realpath</td><td>不涉及</td> </tr> <tr> <td>外部输入包括IPC proxy/stub接口</td><td>不涉及</td> </tr> <tr> <td rowspan="2">数学运算</td><td>混合运算需检查整数溢出</td><td>不涉及</td> </tr> <tr> <td>高精度到低精度转换</td><td>不涉及</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!2935 | 4 天前 | |
【master】【disk】修复告警及目录创建问题 Co-Authored-By: Agent Signed-off-by: zhangchenyang <zhangchenyang30@h-partners.com> | 18 天前 | |
!2950 merge refactor/singleton-meyers-caller into master refactor: 适配DiskManagerClient新GetInstance()接口 Created-by: zhonglufu Commit-by: zhonglufu Merged-by: openharmony_ci Description: ### 相关的Issue https://gitcode.com/openharmony/filemanagement_disk_manager/issues/80 ### 原因(目的、解决的问题等) disk_manager仓已将DiskManagerClient单例实现从DECLARE_DELAYED_SINGLETON替换为Meyers singleton模式,接口从指针变为引用: - 旧:DelayedSingleton<DiskManagerClient>::GetInstance()->Method() - 新:DiskManagerClient::GetInstance().Method() storage_service作为依赖方需要适配新接口。 ### 描述(做了什么,变更了什么) - storage_manager_provider.cpp:15处调用从DelayedSingleton->改为GetInstance().,移除nullptr检查,保留#include <singleton.h>(StorageDaemonCommunication仍使用DelayedSingleton) - mtp_device_manager.cpp:4处调用更新为新接口 - netlink_handler.cpp:1处调用更新为新接口 ### 验证结果(新增、改动、可能影响的功能) - [x] hb build storage_service -i --skip-prebuilts 编译通过 ### 是否已执行mini system用例 [ ] 不涉及。接口适配,不改变外部行为 See merge request: openharmony/filemanagement_storage_service!2950 | 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 | 9 天前 | |
光驱刻录功能适配新架构 Signed-off-by: chenyu_code <chenyu454@h-partners.com> | 17 天前 | |
hdi interface compatible for storage service Signed-off-by: qianyong325 <qianyong15@h-partners.com> | 6 个月前 | |
fix: replace StorageDaemonCommunication DelayedSingleton with Meyer's singleton Change DECLARE_DELAYED_SINGLETON to static local variable GetInstance pattern, eliminating nullptr risk when memory is exhausted. Remove all nullptr checks on sdCommunication since reference is never null. Update all call sites from shared_ptr pattern to reference pattern. Co-Authored-By: Agent Signed-off-by: gzhuangzhuang <gengzhuangzhuang@huawei.com> Change-Id: I01bbfb85f27aa53c8a4e8b128bbd7bb1d2f6201e | 9 天前 | |
!2935 merge fix/storage-daemon-communication-singleton-nullpointer into master fix: DelayedSingleton空指针风险整改(StorageDaemonCommunication/StorageManagerConnect/CjStorageStatusService) Created-by: gzhuangzhuang Commit-by: gzhuangzhuang Merged-by: openharmony_ci Description: **Description:** 将3个类的DelayedSingleton(shared_ptr, 内存耗尽时可能返回nullptr, 调用方未检查会导致崩溃)改为Meyer's singleton(static局部变量引用, C++11线程安全, 永远不为null)。 核心变更: 1. StorageDaemonCommunication: 移除DECLARE_DELAYED_SINGLETON,改为static T& GetInstance()返回引用;所有调用方从GetInstance()->改为GetInstance().;移除nullptr检查 2. StorageManagerConnect: 同上模式;44处kits_impl箭头->改为点.;34处taihe nullptr检查块移除;SmDeathRecipient::OnRemoteDied在内存压力最大的death回调中不再有空指针风险 3. CjStorageStatusService: 同上模式;3处nullptr检查块移除;CjSmDeathRecipient::OnRemoteDied不再有空指针风险 受影响文件25个(生产代码22个+测试文件3个),净减少约400行代码。 **Issue number:** https://gitcode.com/openharmony/filemanagement_storage_service/issues/2345 **Test & Result:** hb build storage_service -i 编译通过 hb build storage_service -t UT编译通过(592个目标全部成功) **CodeCheck:** <table> <tr> <th>类型</th><th>自检项</th><th>自检结果</th> </tr> <tr> <td rowspan="2">多线程相关</td><td>在类的成员变量中定义了容器类型,且在多个成员函数中有操作时,需要加锁保护</td><td>不涉及,原有mutex_保持不变</td> </tr> <tr> <td>定义全局变量,在多个函数中都有操作时,需要加锁保护</td><td>不涉及</td> </tr> <tr> <td rowspan="4">内存相关</td><td>调用外部接口时,确认是否对返回值做了判断,尤其外部接口返回了nullptr的情况</td><td>本PR正是修复此类问题,从可能nullptr改为永远不为null的引用</td> </tr> <tr> <td>调用安全函数时,检查返回值</td><td>不涉及</td> </tr> <tr> <td>检查函数中是否涉及了内存或资源申请,异常退出流程是否释放资源</td><td>Meyer's singleton无需手动new/delete,无内存泄漏风险</td> </tr> <tr> <td>隐式内存分配场景需主动释放或使用智能指针</td><td>static局部变量由C++ runtime管理,无隐式分配</td> </tr> <tr> <td rowspan="4">校验外部输入</td><td>使用nlohmann:json解析外部输入时,需判断参数类型</td><td>不涉及</td> </tr> <tr> <td>外部输入不可信,需判断</td><td>不涉及</td> </tr> <tr> <td>外部输入路径不可信,需使用realpath</td><td>不涉及</td> </tr> <tr> <td>外部输入包括IPC proxy/stub接口</td><td>不涉及</td> </tr> <tr> <td rowspan="2">数学运算</td><td>混合运算需检查整数溢出</td><td>不涉及</td> </tr> <tr> <td>高精度到低精度转换</td><td>不涉及</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!2935 | 4 天前 | |
fix: add lambda capture in MockStorageDaemonNullptr, simplify MockAllSuccess Co-Authored-By: Agent Signed-off-by: gzhuangzhuang <gengzhuangzhuang@huawei.com> Change-Id: I21b188b59b9ca64abaf18c71dbef9e755df84217 | 9 天前 | |
添加hiaudit审计日志 Signed-off-by: cuiruibin <cuiruibin3@h-partners.com> | 3 个月前 | |
Add missing deps for notification_test Add storage_common_utils and storage_manager dependencies to notification_test target to fix the build. Co-Authored-By: Agent Signed-off-by: hunili <lihucheng2@h-partners.com> | 2 天前 | |
initial storage manager dirs create Signed-off-by:gudehe<gudehe@huawei.com> | 4 年前 | |
Merge branch 'feat/taihe-optimize-rom' of git@gitcode.com:yang-li86/filemanagement_storage_service.git into 'master' # Conflicts: # conflict services/storage_manager/BUILD.gn Co-Authored-By: Agent Signed-off-by: yang-li86 <yangli228@h-partners.com> | 2 天前 | |
光驱刻录功能适配新架构 Signed-off-by: chenyu_code <chenyu454@h-partners.com> | 17 天前 | |
数据保护SA解耦初稿 Signed-off-by: lixiyuan <lixiyuan7@huawei.com> | 11 个月前 | |
fix:code Signed-off-by: 2301_76815458 <zhouaoteng@h-partners.com> | 1 个月前 | |
storage_service:空间检测需求加固,低频清理缓存 Signed-off-by: lianwei <lianwei3@huawei.com> | 1 年前 | |
storage_service:空间检测需求加固,低频清理缓存 Signed-off-by: lianwei <lianwei3@huawei.com> | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 11 天前 | ||
| 9 天前 | ||
| 4 个月前 | ||
| 3 天前 | ||
| 9 天前 | ||
| 9 天前 | ||
| 4 天前 | ||
| 18 天前 | ||
| 4 天前 | ||
| 9 天前 | ||
| 17 天前 | ||
| 6 个月前 | ||
| 9 天前 | ||
| 4 天前 | ||
| 9 天前 | ||
| 3 个月前 | ||
| 2 天前 | ||
| 4 年前 | ||
| 2 天前 | ||
| 17 天前 | ||
| 11 个月前 | ||
| 1 个月前 | ||
| 1 年前 | ||
| 1 年前 |