vasi / squashfuse

FUSE filesystem to mount squashfs archives
Other
293 stars 68 forks source link

getdents does not list `.` and `..` files on squashfuse-mounted filesystems #133

Open DrDaveD opened 5 months ago

DrDaveD commented 5 months ago

squashfuse-mounted file systems do not have . and .. files show up from getdents() calls, as is the case with most filesystem mounts including those mounted by the kernel squashfs.

To reproduce:

$ mkdir -p d/d1 mnt
$ touch d/d1/.dotfile
$ mksquashfs d d.squashfs
$ squashfuse d.squashfs mnt
$ ls -a mnt/d1
.dotfile
$ fusermount -u mnt
$ sudo mount -t squashfs d.squashfs mnt
$ ls -a mnt/d1
.  ..  .dotfile
$ sudo umount mnt

In a lot of cases this probably doesn't matter, but it does in some. For example it can cause kinit to crash, see apptainer/apptainer#2143.

vasi commented 5 months ago

Can we compare to the behavior of other FUSE filesystems?

DrDaveD commented 5 months ago

Certainly fuse2fs includes them:

$ mkfs.ext3 -d d/ d.ext3 1M
$ fuse2fs d.ext3 mnt
$ ls -a mnt/d1
.  ..  .dotfile
mgord9518 commented 4 months ago

@vasi This libfuse example also does it