Actions
Bug #55216
closedcephfs-shell: creates directories in local file system even if file not found
Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
% Done:
0%
Source:
Community (dev)
Tags:
backport_processed
Backport:
quincy, pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
cephfs-shell
Labels (FS):
task(easy)
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
The "get" command in cephfs-shell when used to get a file that doesn't exist on ceph filesystem, would throw an error but still would create a directory in the local filesystem:
CephFS:~/>>> get foo /home/dparmar/foo
opendir failed at foo: No such file or directory [Errno 2]
Upon doing "ls" in local filesystem:
[dparmar@fedora ~]$ ls
ceph-prs-repo demo Documents file1 Music Public quickceph sepia-vpn-client.tar.gz ticket_wfh
cephrunrepo Desktop Downloads foo Pictures pycharm.sh rh_resources Templates Videos
It creates directory /home/dparmar/foo/foo which is basically empty.
Solution: There's a block of code in do_get() that upon finding ZERO files, does
os.makedirs(root_dst_dir + b'/' + root_src_dir)
which basically would create this kind of directories. This code can be eliminated and instead directly thrown an error something like "file doesn't exist" and return.
Actions