GNOME Bugzilla – Bug 754634
Update the list of Linux filesystem magic numbers used in get_fs_type
Last modified: 2017-12-19 10:52:35 UTC
Gio uses an internal list to convert Linux filesystem magic numbers to readable strings, but the list is outdated and doesn't recognize some commonly used filesystems such as sysfs, cgroup, efivarfs, fuse. The attached patch adds magic numbers fonud in statfs(2) man page, linux/magic.h header, and GNU coreutils src/stat.c.
Created attachment 310745 [details] [review] glocalfile: Update the list of Linux filesystem magic numbers Add filesystem magic numbers found in statfs(2) manual page, Linux header linux/magic.h, and GNU coreutils src/stat.c. Filesystem magic numbers that are not available from the above sources are copied from Linux source code.
Review of attachment 310745 [details] [review]: I'm not sure it is a good idea to mix information from multiple sources here, and include filesystems that are not in the upstream kernel such as aufs. I would prefer if we stick to just whats in statfs(2). If you're missing a particular filesystem with this approach, send a patch for the manpage to Michael Kerrisk.
(In reply to Matthias Clasen from comment #2) > Review of attachment 310745 [details] [review] [review]: > > I'm not sure it is a good idea to mix information from multiple sources > here, and include filesystems that are not in the upstream kernel such as > aufs. I would prefer if we stick to just whats in statfs(2). If you're > missing a particular filesystem with this approach, send a patch for the > manpage to Michael Kerrisk. Agreed, we should stick to the upstream man page. Can you update the patch please?
Created attachment 365534 [details] [review] glocalfile: Update the list of Linux filesystem magic numbers Add filesystem magic numbers found in statfs(2) manual page. Filesystem magic numbers that are not available from the manual page are copied from Linux source code. These filesystems are removed because they cannot be found in man page: aufs, ceph, exofs, fat, fhgfs, gfs/gfs2, gpfs, hfs+, hfsx, ibrix These filesystems are kept even if they cannot be found in man page because they are used by important system softwares (systemd, gvfs, nfs): configfs, fusectl, rpc_pipefs New filesystems found in man page: btrfs_test_fs, cgroup2, overlay
Created attachment 365535 [details] [review] glocalfile: Update the list of Linux filesystem magic numbers Add filesystem magic numbers found in statfs(2) manual page. Filesystem magic numbers that are not available from the manual page are copied from Linux source code.
Review of attachment 365535 [details] [review]: Could you include a link to the source code you copied the numbers from in your commit message please? Let’s try and make it as easy as possible to reliably update this list in future.
Created attachment 365589 [details] [review] glocalfile: Update the list of Linux filesystem magic numbers Add filesystem magic numbers found in statfs(2) manual page. Filesystem magic numbers that are not available from the manual page are copied from Linux source code. configfs is found in fs/configfs/mount.c, macro CONFIGFS_MAGIC. fusectl is found in fs/fuse/control.c, macro FUSE_CTL_SUPER_MAGIC. rpc_pipefs is found in net/sunrpc/rpc_pipe.c, macro RPCAUTH_GSSMAGIC.
Review of attachment 365589 [details] [review]: OK, thanks.
Attachment 365589 [details] pushed as 8e91aae - glocalfile: Update the list of Linux filesystem magic numbers