public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Richard Weinberger <richard@nod.at>
Cc: Rabin Vincent <rabin.vincent@axis.com>,
	dedekind1@gmail.com, adrian.hunter@intel.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Rabin Vincent <rabinv@axis.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs: allow userspace to map mounts to volumes)
Date: Mon, 29 May 2017 13:08:25 +0100	[thread overview]
Message-ID: <20170529120818.GA6365@ZenIV.linux.org.uk> (raw)
In-Reply-To: <6737a526-18ba-6d8c-f6c8-03f03d74b90a@nod.at>

On Mon, May 29, 2017 at 01:50:30PM +0200, Richard Weinberger wrote:
> CC'ing VFS folks
> 
> Am 29.05.2017 um 09:22 schrieb Rabin Vincent:
> > From: Rabin Vincent <rabinv@axis.com>
> > 
> > There currently appears to be no way for userspace to find out the
> > underlying volume number for a mounted ubifs file system, since ubifs
> > uses anonymous block devices.  The volume name is present in
> > /proc/mounts but UBI volumes can be renamed after the volume has been
> > mounted.
> > 
> > To remedy this, provide a directory in /sys/fs/ubifs named after the
> > underlying anonymous block device's number (obtainable by userspace via
> > stat(2)) and provide a link named "ubi" to the underlying UBI volume.
> 
> I wonder whether it would make more sense to just assign the character device
> number of the UBI volume to ->s_dev.
> Then userspace can query the underlying device without additional sysfs
> magic.
> 
> Sure if userspace expects a block number from UBIFS it will get confused.
> 
> Comments?

Userspace sure as hell does.  st_dev in stat(2) is a block device number;
moreover, there might _be_ a block device with the same number at the same
time - even mounted.  Why not make ->show_options() print the currently
valid volume name, anyway?  That would seem to be the obvious approach...

  reply	other threads:[~2017-05-29 12:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29  7:22 [PATCH v2] ubifs: allow userspace to map mounts to volumes Rabin Vincent
2017-05-29 11:50 ` Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs: allow userspace to map mounts to volumes) Richard Weinberger
2017-05-29 12:08   ` Al Viro [this message]
2017-05-29 14:33     ` Rabin Vincent
2017-05-29 19:37       ` Richard Weinberger

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=20170529120818.GA6365@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adrian.hunter@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rabin.vincent@axis.com \
    --cc=rabinv@axis.com \
    --cc=richard@nod.at \
    /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