master list of FS magic numbers? [Re: stat reports UNKNOWN for cifs

From: Jim Meyering
Date: Thu Oct 08 2009 - 04:17:58 EST


Stuart Kemp wrote:
> Using coreutils 7.6 on Linux
> Running "stat -f /path/to/cifs" on a cifs-mounted path (i.e. mount -t cifs) reports
>
> Type: UNKNOWN (0xff534d42)
>
>
> CIFS_MAGIC_NUMBER is listed in the statfs(2) man-page
>
> CIFS_MAGIC_NUMBER 0xFF534D42
>
> but is not in the switch statement in human_fstype function in stat.c

Thanks!
We were long overdue for an update.
Another new one was listed in that man page: HFS.
However, there were many more in <linux/magic.h>.
So here are two patches to add support for the following names:

afs
cifs
anon-inode FS
btrfs
cgroupfs
cramfs-wend
debugfs
futexfs
hfs
inotifyfs
minux3
securityfs
selinux
xenfs
nilfs

I've made it so "stat -f" will report the following strings
for "file system name". If anyone knows that one of those names
should be spelled differently, please let me know ASAP. In particular,
anon-inode FS seemed better than "anoninodefs", and there's precedent
for names containing spaces. Likewise, I chose cramfs-wend rather
than "cramfswend". However, if there's precedent or any other good
reason for a different spelling, let's fix it now.

These changes add Makefile rules (not well factored, btw)
that will help keep up with additions to the man page and to
<linux/magic.h>, but we should be able to do better. For example,
"nilfs" was not on either, but I was able to dig up its magic number.
If anyone can point to other places that list file system names
and magic numbers, please let us know.