linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v3 0/2] vfs / btrfs: add support for ustat()
@ 2014-08-15  2:58 Luis R. Rodriguez
  2014-08-15  2:58 ` [RFC v3 1/2] fs/super.c: add new super block sub devices super_block_dev Luis R. Rodriguez
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2014-08-15  2:58 UTC (permalink / raw)
  To: viro, clm, jbacik, hch
  Cc: linux-fsdevel, linux-btrfs, linux-kernel, jeffm, fdmanana,
	Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This v3 has this small fix identified by Filipe Manana on the
btrfs specific patch. The v2 series was briefly discussed but
upon providing a use case and reasoning for the way things
were changed I haven't gotten any more further advice or
feedback.

Christoph had noted that this seemed associated to the problem
that the btrfs uses different assignments for st_dev than s_dev,
but much as I'd like to see that changed based on discussions so
far its unclear if this is going to be possible unless strong
commitment is reached. What this tries to do was to take the
other way around the problem, by slowly shifting out junk. I
think this approach might be more feasible over time. I see this
as an extension to Al's original commit 0ee5dc676 but more in line
with how they are really are used and exposes more information to
the VFS. As it stands now other filesystems can pop up and do
similar things, this at least extends the original API to fit
the use case a bit more closely to how its used and allows more
room to grow.

Let's consider this userspace case:

        struct stat buf;
        struct ustat ubuf;

        /* Find a valid device number */
        if (stat("/", &buf)) {
                fprintf(stderr, "Stat failed: %s\n", strerror(errno));
                return 1;
        }

        /* Call ustat on it */
        if (ustat(buf.st_dev, &ubuf)) {
                fprintf(stderr, "Ustat failed: %s\n", strerror(errno));
                return 1;
        }

In the btrfs case it has an inode op for getattr, that is used and we set
the dev to anonymous dev_t. Later ustat will use user_get_super() which
will only be able to work with a userblock if the super block's only
dev_t is assigned to it. Since we have many anonymous to dev_t mapping
to super block though we can't complete the search for btfs and ustat()
fails with -EINVAL. The series expands the number of dev_t's that a super
block can have and allows this search to complete.

Luis R. Rodriguez (2):
  fs/super.c: add new super block sub devices super_block_dev
  btrfs: use the new VFS super_block_dev

 fs/btrfs/ctree.h   |  7 ++----
 fs/btrfs/disk-io.c |  7 +++---
 fs/btrfs/inode.c   |  2 +-
 fs/super.c         | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 include/linux/fs.h | 10 ++++++++
 5 files changed, 82 insertions(+), 12 deletions(-)

-- 
2.0.3


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

end of thread, other threads:[~2021-04-16 17:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-15  2:58 [RFC v3 0/2] vfs / btrfs: add support for ustat() Luis R. Rodriguez
2014-08-15  2:58 ` [RFC v3 1/2] fs/super.c: add new super block sub devices super_block_dev Luis R. Rodriguez
2014-08-15  2:58 ` [RFC v3 2/2] btrfs: use the new VFS super_block_dev Luis R. Rodriguez
2014-08-15  9:29 ` [RFC v3 0/2] vfs / btrfs: add support for ustat() Al Viro
2014-08-17 23:41   ` Luis R. Rodriguez
2017-08-23 22:31   ` Jeff Mahoney
2021-04-15 17:53     ` Luis Chamberlain
2021-04-15 18:17       ` Josef Bacik
2021-04-15 18:29         ` Luis Chamberlain
2021-04-16 17:20           ` Neal Gompa

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).