statmount: requesting more information: statfs, devname, label

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux