util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] refactor mnt_fstype_is_pseudofs()?
@ 2019-01-31 23:07 Stanislav Brabec
  2019-02-04 14:03 ` Karel Zak
  0 siblings, 1 reply; 8+ messages in thread
From: Stanislav Brabec @ 2019-01-31 23:07 UTC (permalink / raw)
  To: util-linux

Hi.

I got a but report about a dumpfs FUSE filesystem reporting bad mount output.

The same problem affects other pseudo file systems not listed in mnt_fstype_is_pseudofs():
# mount | grep encfs
encfs on /Encrypted type fuse.encfs (rw,nosuid,nodev,relatime,user_id=10027,group_id=100,default_permissions)
# mkdir encfs
# mount | grep encfs
/root/encfs on /Encrypted type fuse.encfs (rw,nosuid,nodev,relatime,user_id=10027,group_id=100,default_permissions)
^^^^^^^^^^^

Debugging shows two reasons why it happens:
1) encfs is not listed in mnt_fstype_is_pseudofs()
2) mnt_resolve_path() calls canonicalize_path_and_cache() on the kernel output, which makes only a little sense

Currently I am aware of three file systems affected at least (i. e. not listed): gvfs (subtype was renamed from gvfs-fuse-daemon to gvfsd-fuse), encfs, dumpfs.

Easy fix would be adding all of them to the list. But probably much more exists.

More complex would allow to add fuse.*. But it is not correct, because FUSE can be a regular file system based on block device (e. g. fuse ntfs). Yes, such reports "fuseblk" as a default. But still, it can be changed.

That is why I started thinking about the better fix than adding these three to the list:

If the column 10 (mount source) of a particular line of /proc/<pid>/mountinfo does not start by "/", then it is a pseudofs. Actually, it could be generalized:
- If it does not contain "/" (or maybe another character) at all, it is a pseudofs.
- If it contains "/" (or maybe another character), but it does not start by it, it is a network file system.
- If it starts by "/", it is a regular file system.

Before implementing, I want to make a wider discussion, whether it could work.

I talked with a kernel developers, and he told that there is no solution "correct by principle". Filesystem developer can provide virtually anything as a source. But it could work in most cases.

What do you think about such change?

And additionally: Does canonicalization of the kernel output make any sense? If not, it could be skipped for commands like a bare "mount". (But I am not sure how complicated it would be.)

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-06 10:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 23:07 [RFC] refactor mnt_fstype_is_pseudofs()? Stanislav Brabec
2019-02-04 14:03 ` Karel Zak
2019-02-04 16:38   ` Stanislav Brabec
2019-02-05  9:00     ` Karel Zak
2019-02-05 17:09       ` Stanislav Brabec
2019-02-06 10:51         ` Karel Zak
2019-02-05 22:19   ` Stanislav Brabec
2019-02-06 10:55     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).