From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: <dsterba@suse.cz>, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v3 0/3] btrfs: Add three new unprivileged ioctls to allow normal users to call "sub list/show" etc.
Date: Fri, 13 Apr 2018 13:30:11 +0900 [thread overview]
Message-ID: <5da3d35f-92a3-a9fa-d145-ca108757a8dc@jp.fujitsu.com> (raw)
In-Reply-To: <20180410182354.GH2817@twin.jikos.cz>
On 2018/04/11 3:23, David Sterba wrote:
> On Mon, Mar 19, 2018 at 04:27:09PM +0900, Misono, Tomohiro wrote:
>> changelog:
>>
>> v2-> v3
>> - fix kbuild test bot warning
>> v1 -> v2
>> - completely reimplement 1st/2nd ioctl to have user friendly api
>> - various cleanup, remove unnecessary goto
>> ===
>>
>> This adds three new unprivileged ioctls:
>>
>> 1st patch: ioctl which returns subvolume information of ROOT_ITEM and ROOT_BACKREF
>> 2nd patch: ioctl which returns subvolume information of ROOT_REF (without subvolume name)
>> 3rd patch: user version of ino_lookup ioctl which also peforms permission check.
>
> The overall approach to listing subvolumes looks good. We can enumerate
> them, get the relations and the details. Making some sense of that in
> the userspace is a whole different and maybe more difficult topic.
>
> I hope we could use the opportunity to clean up the listing commandline
> interface and output at the same time, as there's going to be possibly
> some incompatibility introduced.
>
> We need to start with current usecases and how they're implemented or
> mis-implemented (ie. leading to confusion). The discussions I've read so
> far cover a good part of that.
So, I'd like to continue working on progs part based on these ioctls
but there are some things I want to confirm.
I think current problems of "sub list" are:
- printed path is ambiguous\v (the output may differ when specified different path in the fs)
- -a or -o options do not work well
- top level filed is meaningless
My idea of new list is (as in [1]):
- (default, use new ioctls for normal user)\v
list the subvolumes under the specified path, including subvolumes mounted
\v below the specified path. Any user can do this (with appropriate permission checks).
The path to be printed is the relative from the specified path.
- (-a option, use TREE_SEARCH ioctl)
\v list all the subvolmumes in the filesystem. Only root can do this.
The path to be printed is the absolute path from the toplevel subvolume.
- (-o option)
deprecated
and also cleanups of some fields.
For root, TREE_SEARCH ioctl still can be used so that new progs works with old kernels.
Do you have any comments about this?
Also, are you going to merge the omitted libbtrfsuitl patch which refactor "sub list" [2]?
This patch actually does two things:
1. remove subvol print function from libbtrfs (abi break) and
2. refactor "sub list" by using libbtrfsutil.
Is the first part the reason this patch was omitted?
However, by this change subvolume information will be stored in an array instead of rb tree.
In order to implement proposed default behavior, this is a preferred way;
we can't use rb tree because there may exist the subvolume with the same id in different path.
In any case, I'd like to know which version of btrfs-progs I should use to implement the features.
Regards,
Tomohiro Misono
[1] https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg75119.html
[2] https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg73601.html
>
> I'll review and add the kernel patches to misc-next to get some testing
> coverage. As this is a non-restricted ioctl full of pointers and bytes
> shuffled around, we will have to do an extra security-oriented review.
>
>
prev parent reply other threads:[~2018-04-13 4:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 7:27 [PATCH v3 0/3] btrfs: Add three new unprivileged ioctls to allow normal users to call "sub list/show" etc Misono, Tomohiro
2018-03-19 7:27 ` [PATCH v3 1/3] btrfs: Add unprivileged ioctl which returns subvolume information Misono, Tomohiro
2018-03-19 7:27 ` [PATCH v3 2/3] btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF Misono, Tomohiro
2018-03-19 7:28 ` [PATCH v3 3/3] btrfs: Add unprivileged version of ino_lookup ioctl Misono, Tomohiro
2018-04-10 18:23 ` [PATCH v3 0/3] btrfs: Add three new unprivileged ioctls to allow normal users to call "sub list/show" etc David Sterba
2018-04-13 4:30 ` Misono Tomohiro [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=5da3d35f-92a3-a9fa-d145-ca108757a8dc@jp.fujitsu.com \
--to=misono.tomohiro@jp.fujitsu.com \
--cc=dsterba@suse.cz \
--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).