fix: 将toybox ls命令修复挑单到3.0 LTS
错误场景:
OHOS: mount -t nfs 192.168.1.1:/nfs nfs (cwd: /)
OHOS: ls /nfs (成功)
OHOS: ls nfs (成功)
OHOS: cd nfs
OHOS: ls (失败)
错误路径:
1. 以相对路径mount任意文件系统
2. open挂载点获得文件描述符fd
3. 通过fstat接口获取挂载点属性则会发生错误
错误根因:
1. 内核mount接口直接将入参target(挂载点)拷贝到Vnode的filePath字段,如果target为相对路径,则filePath为相对路径;
2. 打开挂载点时,Vnode的filePath直接赋值给文件接口提file的f_path字段;
3. 通过fstat接口查询挂载点属性,内核会调用get_path_from_fd接口获取file的f_path,再调用stat接口查询属性;
4. 由于此时f_path为相对路径,如果fstat时,进程的cwd与挂载时不一致,则导致查找目录失败。
re #I55W66
Signed-off-by: NKiita <zhanyan@huawei.com>
Change-Id: I51a2b1e5a38702555adec5bd345e27f2d3eb74e4
Showing
想要评论请 注册 或 登录