Linux filesystem development
 help / color / mirror / Atom feed
* statmount: requesting more information: statfs, devname, label
@ 2024-05-29 18:36 Thiago Macieira
  2024-05-30  7:16 ` Christian Brauner
  0 siblings, 1 reply; 6+ messages in thread
From: Thiago Macieira @ 2024-05-29 18:36 UTC (permalink / raw)
  To: linux-fsdevel, Miklos Szeredi

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

Hello Miklos & others

Thank you for the listmount() & statmount() API. I found it very easy to use 
and definitely easier than parsing of /proc/self/mountinfo. I am missing three 
pieces of information from statmount(), two of which I can get from elsewhere 
but the third is a showstopper.

The showstopper is the lack of mnt_devname anywhere in the output. It is 
present in mountinfo and even in the older /etc/mtab and I couldn't find a way 
to convert back from the device's major/minor to a string form. Scanning /dev 
will not work because the process in question may not have a populated /dev 
and even if it does, it would be wasteful to scan /dev for all devices. 
Moreover, given symlinks for device-mapper, /dev/dm-1 isn't as descriptive as 
/dev/mapper/system-root or /dev/system/root.

Is there a chance of getting this in a new version of the kernel?

Of the two others, we can get via other system calls, but would be nice if 
statmount() also provided it.

First, the information provided by statfs(), which is the workaround. It's 
easy to call statfs() with the returned mount point path, though that causes a 
minor race.

The second is the filesystem label. The workaround for this is opening the 
mount point and issuing ioctl(FS_IOC_GETFSLABEL), but that again introduces a 
minor race and also requires that the ability to open() the path in question. 
The second fallback to that is to scan /dev/disks/by-label, which is populated 
by udev/udisks/systemd.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5152 bytes --]

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

end of thread, other threads:[~2024-05-30 13:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 18:36 statmount: requesting more information: statfs, devname, label Thiago Macieira
2024-05-30  7:16 ` Christian Brauner
2024-05-30  8:25   ` Miklos Szeredi
2024-05-30 10:42     ` Christian Brauner
2024-05-30 13:33       ` Thiago Macieira
2024-05-30 13:21     ` Thiago Macieira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox