linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Hugo Mills <hugo@carfax.org.uk>,
	Anand Jain <Anand.Jain@oracle.com>,
	Goffredo Baroncelli <kreijack@libero.it>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: introduce BTRFS_IOC_GET_DEVS
Date: Wed, 12 Feb 2014 17:01:23 +0100	[thread overview]
Message-ID: <20140212160123.GP16073@suse.cz> (raw)
In-Reply-To: <20140207102010.GE6490@carfax.org.uk>

On Fri, Feb 07, 2014 at 10:20:10AM +0000, Hugo Mills wrote:
> On Fri, Feb 07, 2014 at 06:08:56PM +0800, Anand Jain wrote:
> >  mainly here sysfs way defeats the purpose - debug as
> >  mentioned. Sysfs would/should show only mounted disks,
> 
>    So let's find a way of showing the "known-about" data structure
> separately from the "mounted" data structure. Just thinking aloud
> here, how about something like this:
> 
> For unmounted, but known filesystems:
> /sys/fs/btrfs/devmap/<UUID>/<symlink to device>   (for each device known)
> /sys/fs/btrfs/devmap/<UUID>/label
> /sys/fs/btrfs/devmap/<UUID>/complete      (0 if missing devices, 1 otherwise)
> /sys/fs/btrfs/devmap/<UUID>/<other properties>

I like that, the device map represents the global state maintained by the
module, does not interfere with the current sysfs structure.

One minor comment, the symlink to device should have probably a fixed
name so it can be easily located.

> And then for mounted filesystems, we can populate the <other
> properties> with more details as appropriate (and remove them when
> unmounted again). We can also add a symlink to the <UUID> directory
> for the filesystem to e.g.:
> 
> /sys/fs/btrfs/mounted/<symlink to UUID>
> 
>    If truly the *only* reason to do this is debug, then simply dump
> the info in debugfs and have done with it. However, there are good
> reasons to want to have this information in an ordinary running
> system, too. So stick with sysfs, IMO.

Agreed.

> >  the ioctl way doesn't have such a limitation (of course
> >  as I commented memory dump way would have been best choice
> >  but I got stuck with that approach if anybody wants to give
> >  a try with that approach you are most welcome).
> > 
> >  IMO no harm to have both sysfs way and ioctl way let user
> >  or developer use which were is suitable in their context.
> 
>    Extra maintenance overhead; divergence of the APIs. "You can find
> out the label of the filesystem using sysfs, but not the ioctl. You
> can find out the size of the filesystem using the ioctl, but not using
> sysfs." That way lies quite a bit of pain for the user of the
> interfaces.

I won't mind having several ways how to get the information, sysfs,
ioctl or the properties. Each way has it's own pros and cons or is
suitable for some type of user (C program, shell scripts).

  reply	other threads:[~2014-02-12 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27  8:52 [PATCH] dump device list as seen by the kernel Anand Jain
2014-01-27  8:52 ` [PATCH] btrfs: introduce BTRFS_IOC_GET_DEVS Anand Jain
2014-01-27  8:47   ` Hugo Mills
2014-01-27  9:08     ` Anand Jain
2014-02-06 19:49     ` David Sterba
2014-02-06 20:09       ` Goffredo Baroncelli
2014-02-06 22:05         ` David Sterba
2014-02-07 10:08           ` Anand Jain
2014-02-07 10:20             ` Hugo Mills
2014-02-12 16:01               ` David Sterba [this message]
2014-02-12 16:15                 ` Hugo Mills
2014-02-25 17:45                   ` David Sterba
2014-02-26  2:34                     ` Anand Jain
2014-01-27  8:56 ` [PATCH] btrfs-progs: introduce btrfs-devlist Anand Jain

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=20140212160123.GP16073@suse.cz \
    --to=dsterba@suse.cz \
    --cc=Anand.Jain@oracle.com \
    --cc=hugo@carfax.org.uk \
    --cc=kreijack@libero.it \
    --cc=linux-btrfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).