Project

General

Profile

Actions

Bug #55216

closed

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

Added by Dhairya Parmar about 2 years ago. Updated over 1 year 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 1 (0 open1 closed)

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

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
Actions #2

Updated by Dhairya Parmar about 2 years ago

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

Updated by Venky Shankar almost 2 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #4

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
Actions #5

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
Actions #6

Updated by Dhairya Parmar almost 2 years ago

  • Pull request ID changed from 45826 to 45829
Actions #7

Updated by Backport Bot over 1 year ago

  • Tags set to backport_processed
Actions #8

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)
Actions #9

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

Also available in: Atom PDF