Project

General

Profile

Bug #55216

cephfs-shell: creates directories in local file system even if file not found

Added by Dhairya Parmar 8 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
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.


Related issues

Copied to CephFS - Backport #55628: quincy: cephfs-shell: creates directories in local file system even if file not found Resolved

History

#1 Updated by Venky Shankar 8 months ago

  • Assignee set to Dhairya Parmar
  • Target version set to v18.0.0
  • Source set to Community (dev)
  • Backport set to quincy, pacific

#2 Updated by Dhairya Parmar 8 months ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 45826

#3 Updated by Venky Shankar 7 months ago

  • Status changed from Fix Under Review to Pending Backport

#4 Updated by Backport Bot 7 months ago

  • Copied to Backport #55627: pacific: cephfs-shell: creates directories in local file system even if file not found added

#5 Updated by Backport Bot 7 months ago

  • Copied to Backport #55628: quincy: cephfs-shell: creates directories in local file system even if file not found added

#6 Updated by Dhairya Parmar 7 months ago

  • Pull request ID changed from 45826 to 45829

#7 Updated by Backport Bot 4 months ago

  • Tags set to backport_processed

#8 Updated by Dhairya Parmar 4 months ago

  • Copied to deleted (Backport #55627: pacific: cephfs-shell: creates directories in local file system even if file not found)

#9 Updated by Dhairya Parmar 4 months ago

  • Status changed from Pending Backport to Resolved

PR along with backport PRs merged. Marking as resolved.

Also available in: Atom PDF