Project

General

Profile

Bug #1957

ceph-fuse: have "." and ".." entries consistently

Added by Anonymous almost 12 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I was cleaning old emails and found this: http://marc.info/?l=ceph-devel&m=130688351921306&w=2

Quick experiment says:

$ ls -a -l
total 1
drwxr-xr-x 1 root root 0 2012-01-20 14:51 ./
$ mkdir z
$ ls -la z
total 1
drwxr-xr-x 1 root root 0 2012-01-20 14:52 ./
drwxr-xr-x 1 root root 0 2012-01-20 14:52 ../

So it seems subdirectories currently get a "..", but the top-level doesn't. Counterexample for /proc:

$ ls -la /proc|head -3
total 4
dr-xr-xr-x 213 root       root                     0 2012-01-17 00:37 ./
drwxr-xr-x  24 root       root                  4096 2011-11-22 09:51 ../

Associated revisions

Revision fd205da1 (diff)
Added by Sam Lang about 11 years ago

cfuse: Add the parent entry (..) for a top-level readdir

In the lowlevel fuse api, the current (.) and parent (..) entries
must be added manually in a readdir call. For the root directory
the parent is not a ceph inode, so we give it a fake inode value
(2) and intercept that inode on a getattr.

Fixes: #1957
Signed-off-by: Sam Lang <>

History

#1 Updated by Sage Weil almost 12 years ago

this is specifically me not know how to handle .. on the root directory with fuse. sshfs does it, though, so it's possible; someone needs to look at that code.

#2 Updated by Sam Lang about 11 years ago

  • Assignee set to Sam Lang

It looks like the trick is to use a fake inode number when filling in the parent (..) entry. I chose 2, as 1 is already taken to refer to the root dir.

#3 Updated by Sage Weil about 11 years ago

  • Status changed from New to Resolved

#4 Updated by John Spray about 7 years ago

  • Project changed from Ceph to CephFS
  • Category deleted (11)

Bulk updating project=ceph category=ceph-fuse issues to move to fs project so that we can remove the ceph-fuse category from the ceph project

Also available in: Atom PDF