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.
Updated by Venky Shankar about 2 years ago
- Assignee set to Dhairya Parmar
- Target version set to v18.0.0
- Source set to Community (dev)
- Backport set to quincy, pacific
Updated by Dhairya Parmar about 2 years ago
- Status changed from New to Fix Under Review
- Pull request ID set to 45826
Updated by Venky Shankar almost 2 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Backport Bot almost 2 years ago
- Copied to Backport #55627: pacific: cephfs-shell: creates directories in local file system even if file not found added
Updated by Backport Bot almost 2 years ago
- Copied to Backport #55628: quincy: cephfs-shell: creates directories in local file system even if file not found added
Updated by Dhairya Parmar almost 2 years ago
- Pull request ID changed from 45826 to 45829
Updated by Dhairya Parmar over 1 year ago
- Copied to deleted (Backport #55627: pacific: cephfs-shell: creates directories in local file system even if file not found)
Updated by Dhairya Parmar over 1 year ago
- Status changed from Pending Backport to Resolved
PR along with backport PRs merged. Marking as resolved.
Actions