Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false directory cycle because all zfs filesystems share the same device inode #140

Closed
dajhorn opened this issue Mar 5, 2011 · 1 comment

Comments

@dajhorn
Copy link
Contributor

dajhorn commented Mar 5, 2011

All ZFS filesystems share the same device inode, which confuses programs that check for directory cycles by keeping a list of mount points. For example:

$ find /tank
find: File system loop detected; '/tank/teacup' is part of the same file system loop as '/tank'.

$ du -sh /tank
du: WARNING: Circular directory structure.
This almost certainly means that you have a corrupted file system.
NOTIFY YOUR SYSTEM MANAGER
The following directory is part of the cycle: '/tank/teacup'

These two examples are in the Linux coreutils package, in lib/fts-cycle.c file, in the enter_dir() function.

@behlendorf
Copy link
Contributor

Set stat->st_dev and statfs->f_fsid

Filesystems like ZFS must use what the kernel calls an anonymous super
block. Basically, this is just a filesystem which is not backed by a
single block device. Normally this block device's dev_t is stored in
the super block. For anonymous super blocks a unique reserved dev_t
is assigned as part of get_sb().

This sb->s_dev must then be set in the returned stat structures as
stat->st_dev. This allows userspace utilities to easily detect the
boundries of a specific filesystem. Tools such as 'du' depend on this
for proper accounting.

Additionally, under OpenSolaris the statfs->f_fsid is set to the device
id. To preserve consistency with OpenSolaris we also set the fsid to
the device id. Other Linux filesystem (ext) set the fsid to a unique
value determined by the filesystems uuid. This value is unique but
maintains no relationship to the device id. This may be desirable
when exporting NFS filesystem because it minimizes to chance of a
client observing the same fsid from two different servers.

Closed by 53cf50e

@bud4 bud4 mentioned this issue Jun 8, 2018
ixhamza added a commit to ixhamza/zfs that referenced this issue Nov 15, 2023
linux 6.3 compat changes for truenas/zfs-2.2-release
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants