After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754634 - Update the list of Linux filesystem magic numbers used in get_fs_type
Update the list of Linux filesystem magic numbers used in get_fs_type
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.43.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-09-06 10:39 UTC by Ting-Wei Lan
Modified: 2017-12-19 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glocalfile: Update the list of Linux filesystem magic numbers (4.63 KB, patch)
2015-09-06 10:41 UTC, Ting-Wei Lan
none Details | Review
glocalfile: Update the list of Linux filesystem magic numbers (4.08 KB, patch)
2017-12-14 13:20 UTC, Ting-Wei Lan
none Details | Review
glocalfile: Update the list of Linux filesystem magic numbers (4.08 KB, patch)
2017-12-14 13:22 UTC, Ting-Wei Lan
none Details | Review
glocalfile: Update the list of Linux filesystem magic numbers (4.28 KB, patch)
2017-12-15 15:00 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2015-09-06 10:39:59 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.
Comment 1 Ting-Wei Lan 2015-09-06 10:41:21 UTC
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.
Comment 2 Matthias Clasen 2015-09-07 17:16:28 UTC
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.
Comment 3 Philip Withnall 2017-11-06 11:18:56 UTC
(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?
Comment 4 Ting-Wei Lan 2017-12-14 13:20:12 UTC
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
Comment 5 Ting-Wei Lan 2017-12-14 13:22:50 UTC
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.
Comment 6 Philip Withnall 2017-12-15 11:25:52 UTC
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.
Comment 7 Ting-Wei Lan 2017-12-15 15:00:30 UTC
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.
Comment 8 Philip Withnall 2017-12-19 09:52:04 UTC
Review of attachment 365589 [details] [review]:

OK, thanks.
Comment 9 Ting-Wei Lan 2017-12-19 10:52:24 UTC
Attachment 365589 [details] pushed as 8e91aae - glocalfile: Update the list of Linux filesystem magic numbers