Linux filesystem development
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Thiago Macieira <thiago.macieira@intel.com>
Cc: linux-fsdevel@vger.kernel.org, Miklos Szeredi <mszeredi@redhat.com>
Subject: Re: statmount: requesting more information: statfs, devname, label
Date: Thu, 30 May 2024 09:16:35 +0200	[thread overview]
Message-ID: <20240530-hygiene-einkalkulieren-c190143e41d9@brauner> (raw)
In-Reply-To: <11382958.Mp67QZiUf9@tjmaciei-mobl5>

On Wed, May 29, 2024 at 03:36:39PM -0300, Thiago Macieira wrote:
> 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.

I think that mnt_devname makes sense!
I don't like the other additions because they further blur the
distinction between mount and filesystem information.

  reply	other threads:[~2024-05-30  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29 18:36 statmount: requesting more information: statfs, devname, label Thiago Macieira
2024-05-30  7:16 ` Christian Brauner [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240530-hygiene-einkalkulieren-c190143e41d9@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=thiago.macieira@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox