All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Goffredo Baroncelli <kreijack@libero.it>
Cc: linux-btrfs@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH RFC V3] new ioctl BTRFS_IOC_GET_CHUNK_INFO
Date: Mon, 25 May 2020 18:39:41 +0200	[thread overview]
Message-ID: <20200525163941.GW18421@twin.jikos.cz> (raw)
In-Reply-To: <20200319203913.3103-1-kreijack@libero.it>

On Thu, Mar 19, 2020 at 09:39:12PM +0100, Goffredo Baroncelli wrote:
> This patch creates a new ioctl BTRFS_IOC_GET_CHUNK_INFO.
> The aim is to replace the BTRFS_IOC_TREE_SEARCH ioctl
> used by "btrfs fi usage" to obtain information about the 
> chunks/block groups. 
> 
> The problems in using the BTRFS_IOC_TREE_SEARCH is that it access
> the very low data structure of BTRFS. This means: 
> 1) this would be complicated a possible change of the disk format
> 2) it requires the root privileges
> 
> The BTRFS_IOC_GET_CHUNK_INFO ioctl can be called even from a not root
> user: I think that the data exposed are not sensibile data.
> 
> These patches allow to use "btrfs fi usage" without root privileges.
> 
> before:
> -------------------------------------------
> 
> $ btrfs fi us /
> WARNING: cannot read detailed chunk info, per-device usage will not be shown, run as root
> Overall:
>     Device size:                 100.00GiB
>     Device allocated:             26.03GiB
>     Device unallocated:           73.97GiB
>     Device missing:                  0.00B
>     Used:                         17.12GiB
>     Free (estimated):             80.42GiB      (min: 80.42GiB)
>     Data ratio:                       1.00
>     Metadata ratio:                   1.00
>     Global reserve:               53.12MiB      (used: 0.00B)
> 
> Data,single: Size:23.00GiB, Used:16.54GiB (71.93%)
> 
> Metadata,single: Size:3.00GiB, Used:588.94MiB (19.17%)
> 
> System,single: Size:32.00MiB, Used:16.00KiB (0.05%)
> 
> after:
> -----------------------------------------------
> $ ./btrfs fi us /
> Overall:
>     Device size:                 100.00GiB
>     Device allocated:             26.03GiB
>     Device unallocated:           73.97GiB
>     Device missing:                  0.00B
>     Used:                         17.12GiB
>     Free (estimated):             80.42GiB      (min: 80.42GiB)
>     Data ratio:                       1.00
>     Metadata ratio:                   1.00
>     Global reserve:               53.12MiB      (used: 0.00B)
> 
> Data,single: Size:23.00GiB, Used:16.54GiB (71.93%)
>    /dev/sdd3      23.00GiB
> 
> Metadata,single: Size:3.00GiB, Used:588.94MiB (19.17%)
>    /dev/sdd3       3.00GiB
> 
> System,single: Size:32.00MiB, Used:16.00KiB (0.05%)
>    /dev/sdd3      32.00MiB
> 
> Unallocated:
>    /dev/sdd3      73.97GiB
> 
> Comments are welcome

I'm going to send more comments, the new ioctl is among features
considered for 5.9.

      parent reply	other threads:[~2020-05-25 16:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 20:39 [PATCH RFC V3] new ioctl BTRFS_IOC_GET_CHUNK_INFO Goffredo Baroncelli
2020-03-19 20:39 ` [PATCH rfc v3] New " Goffredo Baroncelli
2020-03-19 20:59   ` Josef Bacik
2020-03-19 21:09     ` Goffredo Baroncelli
2020-05-25 17:14   ` David Sterba
2020-05-26 20:19     ` Goffredo Baroncelli
2020-05-28 21:03       ` Hans van Kranenburg
2020-05-29 16:23         ` Goffredo Baroncelli
2020-05-29 18:54           ` Hans van Kranenburg
2020-05-29 18:59             ` Hans van Kranenburg
2020-05-30  6:41             ` Goffredo Baroncelli
2020-06-10 20:30       ` David Sterba
2020-06-11 11:50         ` Goffredo Baroncelli
2020-06-14 11:06           ` Goffredo Baroncelli
2020-05-25 16:39 ` David Sterba [this message]

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=20200525163941.GW18421@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.