Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume containing this inode.
(i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
Reviewed-by: Gu Jinxiang <g...@cn.fujitsu.com>
Tested-by: Gu Jinxiang <g...@cn.fujitsu.com>
Signed-off-
mentation of btrfs-progs can be found in the ML titled as follows:
[PATCH 0/11] btrfs-progs: Rework of "subvolume list/show" and relax the root
privileges of them
Tomohiro Misono (3):
btrfs: Add unprivileged ioctl which returns subvolume information
btrfs: Add unprivileged ioctl whic
BTRFS_MAX_ROOTREF_BUFFER_NUM, -EOVERFLOW
is returned. Therefore the caller can just call this ioctl again without
changing the argument to continue search.
Reviewed-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Gu Jinxiang <g...@cn.fujitsu.com>
Tested-by: Gu Jinxiang <g...@cn.fujitsu.com>
Signe
ted-by: Gu Jinxiang <g...@cn.fujitsu.com>
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/ioctl.c | 204 +
include/uapi/linux/btrfs.h | 17
2 files changed, 221 insertions(+)
diff --git a/fs/btrfs/ioctl.c b/f
subvolume is also searched and filled.
Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1)
bytes than ino_lookup ioctl because of space of subvolume's name.
Reviewed-by: Gu Jinxiang <g...@cn.fujitsu.com>
Reviewed-by: Qu Wenruo <w...@suse.com>
Signed-o
Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume containing this inode.
(i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
v5 -> v6
- Use brfs_read_fs_roo
relax the root
privileges of them
Tomohiro Misono (3):
btrfs: Add unprivileged ioctl which returns subvolume information
btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF
btrfs: Add unprivileged version of ino_lookup ioctl
fs/btrfs/ioctl.c | 431
BTRFS_MAX_ROOTREF_BUFFER_NUM, -EOVERFLOW
is returned. Therefore the caller can just call this ioctl again without
changing the argument to continue search.
Reviewed-by: Qu Wenruo <w...@suse.com>
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
v4 -> v5
- Update
es which only depend on kernel version. New attribute_group
"btrfs_static_feature_attr_group" is created for this purpose.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/sysfs.c | 29 +
1 file changed, 29 insertions(+)
diff
nup and the second one is a main part.
Tomohiro Misono (2):
btrfs: sysfs: Use enum/define value intead of magic number
btrfs: sysfs: Add entry which shows rmdir(2) can work for subvolume
fs/btrfs/sysfs.c | 40 +++-
fs/btrfs/sysfs.h | 4 ++--
2 files chan
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/sysfs.c | 11 ++-
fs/btrfs/sysfs.h | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index fa6c8c88b250..217d401fe8ae 100644
--- a/fs/btrfs/s
Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume containing this inode.
(i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
v4 -> v5
- Update error
it log for more detals.
The implementation of btrfs-progs can be found in the ML titled as follows:
[PATCH 0/11] btrfs-progs: Rework of "subvolume list/show" and relax the root
privileges of them
Tomohiro Misono (3):
btrfs: Add unprivileged ioctl which returns subvolume information
btr
BTRFS_MAX_ROOTREF_BUFFER_NUM, -EOVERFLOW
is returned. Therefore the caller can just call this ioctl again without
changing the argument to continue search.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
v4 -> v5
- Update error handling of btrfs_next_leaf() to cover all cases
of bottom subvolume is also searched and filled.
Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1)
bytes than ino_lookup ioctl because of space of subvolume's name.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/ioctl.c
and list them as well
- Remove obsolete field (i.e. top-level) from output
Any comments are welcome.
Thanks,
Tomohiro Misono
[1] https://www.spinics.net/lists/linux-btrfs/msg76008.html
[2] https://www.spinics.net/lists/linux-btrfs/msg74917.html
Tomohiro Misono (11):
btrfs-prog
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
tests/cli-tests/009-subvolume-list/test.sh | 136 +
1 file changed, 136 insertions(+)
create mode 100755 tests/cli-tests/009-subvolume-list/test.sh
diff --git a/tests/cli-tests/009-subvolum
By using new ioctl (BTRFS_IOC_GET_SUBVOL_INFO), this commit allows
non-privileged user to call util_subvolume_info() as long as @id is zero
(user can only get the information of the subvolume which he can open).
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
libbtr
Factor out the main logic of btrfs_util_subvolume_iterator_next().
This is a prepareation work to update the behavior of this function
and relax the required root privilege.
No functional change happens.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
libbtr
, non-privileged user can
also use the iterator. If @top is specified, the behavior is the same
as before (and thus non-privileged user cannot use).
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
libbtrfsutil/btrfsutil.h | 19 ++-
libbtrfsutil/errors.c| 4 +
libbtr
Sandoval <osan...@fb.com>
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
cmds-subvolume.c | 961 +--
1 file changed, 934 insertions(+), 27 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 45363a
Add 3 definitions of new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO,
BTRFS_IOC_GET_SUBVOL_ROOTREF and BTRFS_IOC_INO_LOOKUP_USER). They will
be used to implement the user version of "btrfs subvolume list" etc.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com&
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils.c b/utils.c
index d81d4980..84b81311 100644
--- a/utils.c
+++ b/utils.c
@@ -2048,6 +2048,9 @@ int find_mount_root(const char *path, char **mount_ro
T_SUBVOL_INFO/BTRFS_IOC_GET_ROOTREF/
BTRFS_IOC_INO_LOOKUP_USER),
- the specified path can be non-subvolume directory.
- non-privileged user can also call it.
Note that root user can list all the subvolume in the fs with -a option
(the same behavior as before).
Signed-off-by: Tomohiro Misono
list all snapshots in the fs (inc. non-accessible ones)
user ... subvolume path is from mount point
list snapshots under the mountpoint
(to which the user has appropriate privileges)
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
BTRFS_MAX_ROOTREF_BUFFER_NUM, -EOVERFLOW
is returned. Therefore the caller can just call this ioctl again without
changing the argument to continue search.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/ioctl.c | 102 +
i
Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume containing this inode.
(i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/ioctl.c
of bottom subvolume is also searched and filled.
Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1)
bytes than ino_lookup ioctl because of space of subvolume's name.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
fs/btrfs/ioctl.c
quot;subvolume list/show" and relax the root
privileges of them
Tomohiro Misono (3):
btrfs: Add unprivileged ioctl which returns subvolume information
btrfs: Add unprivileged ioctl which returns subvolume's ROOT_REF
btrfs: Add unprivileged version of ino_lookup ioctl
fs/
29 matches
Mail list logo