ogs <= 4.19
$ mount -o subvol=AAA $DEV /mnt
$ btrfs subvolume list /mnt
ID 256 gen 11 top level 5 path AAA
ID 257 gen 8 top level 256 path BBB
ID 258 gen 8 top level 257 path BBB/dir/CCC
ID 259 gen 11 top level 256 path ZZZ
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
No functional changes.
This is a preparation work for reworking "subvolume list".
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
cmds-subvolume.c | 50 +---
1 file changed, 30 insertions(+), 20 deletions(-)
diff --
t;.
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils.c b/utils.c
index 3a4bc92a..8ce8417d 100644
--- a/utils.c
+++ b/utils.c
@@ -2054,6 +2054,9 @@ int find_mount_root(const char *path, char **mount_roo
it is relative to top-level subvolume)
Also, snapshots to be shown are to which the user can access from current
mount point.
(for root, all snapshots in the fs)
===
[1]
https://lore.kernel.org/linux-btrfs/cover.1529310485.git.misono.tomoh...@jp.fujitsu.com/
[
Add helper function to check that if user 'nobody' exists or not.
Note that 'nobody' should not have root privileges as it will be used
to test the behavior of non-privileged user.
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
tests/common | 10 ++
path AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
** output of progs <= 4.19
$ btrfs subvolume list -a /mnt
ID 256 gen 9 top level 5 path AAA
ID 257 gen 9 top level 256 path /AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
Do
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
tests/cli-tests/009-subvolume-list/test.sh | 130 +
1 file changed, 130 insertions(+)
create mode 100755 tests/cli-tests/009-subvolume-list/test.sh
diff --git a/tests/cli-tests/009-subvolume-list/test.sh
b
:15e80697-2ffb-0b4b-8e1e-e0873a7cf944
...
Snapshot(s):
/mnt/snap2
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
Documentation/btrfs-subvolume.asciidoc | 11 ++-
cmds-subvolume.c | 107 ++---
2 files
Sandoval
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
cmds-subvolume.c | 963 +--
1 file changed, 936 insertions(+), 27 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index a8395aac..84a03fd8 100644
--- a/cmds-subvolume.c
btrfs/150 uses RAID1 profile and make SCRATCH_DEV fail for test.
However, if SCRATCH_DEV_POOL consists more than two devices, SCRATCH_DEV
may not be used for RAID1 pair and the tests may not run as expected.
Fix this by add _scratch_dev_pool_get/put like other tests (141, 143
etc.) do.
Signed-off
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
>
> The C libbtrfsutil library isn't very useful for scripting, so we also
> want bindings for Python. Writing unit tests in Python is also much
> easier than doing so in C. Only Python 3 is supported; if someone really
> wants Python
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
>
> set_default_subvolume() is a trivial ioctl(), but there's no ioctl() for
> get_default_subvolume(), so we need to search the root tree.
>
> Signed-off-by: Omar Sandoval
> ---
> libbtrfsutil/btrfsutil.h| 41
On 2018/02/16 4:05, Omar Sandoval wrote:
> From: Omar Sandoval
>
> btrfs_util_f_deleted_subvolumes() replaces enumerate_dead_subvols() and
> btrfs_util_f_subvolume_info() replaces is_subvolume_cleaned().
>
> Signed-off-by: Omar Sandoval
> ---
> cmds-subvolume.c | 217
> ++---
On 2018/02/16 4:05, Omar Sandoval wrote:
> From: Omar Sandoval
>
> btrfs_util_f_deleted_subvolumes() replaces enumerate_dead_subvols() and
> btrfs_util_f_subvolume_info() replaces is_subvolume_cleaned().
And, the function names are older version.
>
> Signed-off-by: Omar Sandoval
> ---
> cmds
On 2018/02/16 4:05, Omar Sandoval wrote:
> From: Omar Sandoval
>
> Signed-off-by: Omar Sandoval
> ---
> messages.h | 13
> props.c| 69
> +++---
> 2 files changed, 38 insertions(+), 44 deletions(-)
>
> diff --git a/mes
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
>
> Signed-off-by: Omar Sandoval
> ---
> libbtrfsutil/btrfsutil.h| 21 +++
> libbtrfsutil/python/btrfsutilpy.h | 3 +
> libbtrfsutil/python/module.c| 30 ++
> libbtrfsutil/
On 2018/02/16 4:05, Omar Sandoval wrote:
> From: Omar Sandoval
> +static struct subvol_list *btrfs_list_deleted_subvols(int fd,
> + struct
> btrfs_list_filter_set *filter_set)
> +{
> + struct subvol_list *subvols = NULL;
> + uint64_t *i
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
> +PUBLIC enum btrfs_util_error btrfs_util_subvolume_path_fd(int fd, uint64_t
> id,
> + char **path_ret)
> +{
> + char *path, *p;
> + size_t capacity = 4096;
> +
> + p
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
> +PUBLIC enum btrfs_util_error btrfs_util_create_subvolume_iterator(const char
> *path,
> + uint64_t top,
> +
On 2018/02/16 4:04, Omar Sandoval wrote:
> From: Omar Sandoval
> +static enum btrfs_util_error openat_parent_and_name(int dirfd, const char
> *path,
> + char *name, size_t name_len,
> + int *fd)
> +{
On 2018/02/24 8:33, Omar Sandoval wrote:
> On Fri, Feb 23, 2018 at 11:12:56AM +0900, Misono, Tomohiro wrote:
>>
>> On 2018/02/16 4:04, Omar Sandoval wrote:
>>> From: Omar Sandoval
>>>
>>> Signed-off-by: Omar Sandoval
>>> ---
&g
On 2018/03/02 14:22, Qu Wenruo wrote:
> Btrfs shows max_inline option into kernel message, but for
> max_inline=4096, btrfs won't really inline 4096 bytes inline data if
> it's not compressed.
Hello,
I have a question.
man mount(8) says:
max_inline=bytes
Specify the maximum amoun
This adds two new unprivileged ioctls:
1st patch: version of tree_search ioctl which only searches/returns subvolume
related item.
2nd patch: user version of ino_lookup ioctl which also performs permission
check.
They will be used to implement user version of "subvolume list/show" etc in
user
Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches
and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF)
from root tree. The arguments of this ioctl are the same as treesearch
ioctl and can be used like treesearch ioctl.
Since treesearch ioctl requires root p
Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER)
to allow normal users to call "btrfs subvololume list/show" etc. in
combination with BTRFS_IOC_GET_SUBVOL_INFO.
This can be used like BTRFS_IOC_INO_LOOKUP but the argument is
different because it also returns the name of bott
This RFC implements user version of "subvolume list/show" using two new ioctls.
The ioctl patch to the kernel can be found in the ML titled
"[PATCH 0/2] btrfs: Add two new unprivileged ioctls to allow normal users to
call "sub list/show" etc."
1st-4th are some prepartion works.
5th patch is th
Add 2 definitions of new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO
and BTRFS_IOC_INO_LOOKUP_USER). They will be used to implement
user version of "btrfs subvolume list" etc.
Signed-off-by: Tomohiro Misono
---
ioctl.h | 19 +++
1 file changed, 19 insertions(+)
diff --git a/io
This is a preparetion work to allow normal user to call "subvolume list".
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 30 ++
btrfs-list.h | 1 +
2 files changed, 31 insertions(+)
diff --git a/btrfs-list.c b/btrfs-list.c
index e01c5899..aea917c5 100644
--- a/bt
This is a preparetion work to allow normal user to call "subvolume list".
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 16 +---
btrfs-list.h | 7 ---
cmds-subvolume.c | 6 +++---
utils.c | 10 +-
4 files changed, 21 insertions(+), 18 deletions(-)
O_NOATIME flag requires effective UID of process matches file's owner
or has CAP_FOWNER capabilities. Fallback to open without O_NOATIME flag
so that normal user can also call find_mount_root().
This is a preparation work to allow normal user to call "subvolume show".
Signed-off-by: Tomohiro Miso
Allow normal user to call "subvolume list/show" by using 2 new
unprivileged ioctls (BTRFS_IOC_GET_SUBVOL_INFO and
BTRFS_IOC_INO_LOOKUP_USER).
Note that for root, "subvolume list" returns all the subvolume in the
filesystem by default, but for normal user, it returns subvolumes
which exist under th
Test user 'progs-test' will be used to test the behavior of normal user.
In order to pass this check, add the user by "useradd -M progs-test".
Note that progs-test should not have root privileges.
Signed-off-by: Tomohiro Misono
---
tests/common | 10 ++
1 file changed, 10 insertions(+)
Signed-off-by: Tomohiro Misono
---
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-subvolume-list/test.sh
b/tests/cli-tests/009-subv
On 2018/03/07 5:29, Goffredo Baroncelli wrote:
> On 03/06/2018 09:30 AM, Misono, Tomohiro wrote:
>> Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches
>> and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF)
>> from root tree. The argume
On 2018/03/06 17:31, Misono, Tomohiro wrote:
> Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER)
> to allow normal users to call "btrfs subvololume list/show" etc. in
> combination with BTRFS_IOC_GET_SUBVOL_INFO.
>
> This can be used like BTR
On 2018/03/03 3:47, je...@suse.com wrote:
> From: Jeff Mahoney
>
> The only mechanism we have in the progs for searching qgroups is to load
> all of them and filter the results. This works for qgroup show but
> to add quota information to 'btrfs subvoluem show' it's pretty wasteful.
>
> This pa
On 2018/03/08 4:00, Goffredo Baroncelli wrote:
> On 03/07/2018 01:40 AM, Misono, Tomohiro wrote:
>> On 2018/03/07 5:29, Goffredo Baroncelli wrote:
>>> On 03/06/2018 09:30 AM, Misono, Tomohiro wrote:
>>>> Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which
On 2018/03/08 17:29, Nikolay Borisov wrote:
>
>
> On 6.03.2018 10:30, Misono, Tomohiro wrote:
>> Add new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO) which searches
>> and returns only subvolume related item (ROOT_ITEM/ROOT_BACKREF/ROOT_REF)
>> from root tree. The
On 2018/03/08 18:47, Nikolay Borisov wrote:
>
>
> On 6.03.2018 10:31, Misono, Tomohiro wrote:
>> Add unprivileged version of ino_lookup ioctl (BTRFS_IOC_INO_LOOKUP_USER)
>> to allow normal users to call "btrfs subvololume list/show" etc. in
>> combi
changelog:
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 subvo
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
---
fs/btrfs/ioctl.c | 118 +
Add unprivileged ioctl BTRFS_IOC_GET_SUBVOL_ROOTREF which
returns ROOT_REF information of the subvolume containing this inode.
The min id of root ref's subvolume to be searched is specified by
min_id in struct btrfs_ioctl_get_subvol_rootref_args.
If there are more root refs than BTRFS_MAX_ROOTREF_
Add unprivileged version of ino_lookup ioctl BTRFS_IOC_INO_LOOKUP_USER
to allow normal users to call "btrfs subvololume list/show" etc. in
combination with BTRFS_IOC_GET_SUBVOL_INFO/BTRFS_IOC_GET_SUBVOL_ROOTREF.
This can be used like BTRFS_IOC_INO_LOOKUP but the argument is
different. This is bec
After btrfs_list_subvols() is called, root_lookup may hold some allocated
memory area even if the function fails.
Therefore rb_free_nodes() should be called.
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/btrf
changelog:
v1 -> v2
- add independent error handling patch (1st patch)
- reimplement according to ioctl change
- various cleanup
===
This RFC implements user version of "subvolume list/show" using three new
ioctls.
The ioctl patch to the kernel can be found in the ML titled
"[PATCH v2 0/
This is a preparetion work to allow normal user to call
"subvolume list/show".
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 33 +
btrfs-list.h | 1 +
2 files changed, 34 insertions(+)
diff --git a/btrfs-list.c b/btrfs-list.c
index 50e5ce5f..88689a9d 100644
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 user version of "btrfs subvolume list" etc.
Signed-off-by: Tomohiro Misono
---
ioctl.h | 86
This is a preparetion work to allow normal user to call
"subvolume list/show".
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 16 +---
btrfs-list.h | 7 ---
cmds-subvolume.c | 6 +++---
utils.c | 10 +-
4 files changed, 21 insertions(+), 18 deletions
O_NOATIME flag requires effective UID of process matches file's owner
or has CAP_FOWNER capabilities. Fallback to open without O_NOATIME flag
so that normal user can also call find_mount_root().
This is a preparation work to allow normal user to call "subvolume show".
Signed-off-by: Tomohiro Miso
Test user 'progs-test' will be used to test the behavior of normal user.
In order to pass this check, add the user by "useradd -M progs-test".
Note that progs-test should not have root privileges.
Signed-off-by: Tomohiro Misono
---
tests/common | 10 ++
1 file changed, 10 insertions(+)
Allow normal user to call "subvolume list/show" by using 3 new
unprivileged ioctls (BTRFS_IOC_GET_SUBVOL_INFO,
BTRFS_IOC_GET_SUBVOL_ROOTREF and BTRFS_IOC_INO_LOOKUP_USER).
Note that for root, "subvolume list" returns all the subvolume in the
filesystem by default, but for normal user, it returns s
Signed-off-by: Tomohiro Misono
---
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-subvolume-list/test.sh
b/tests/cli-tests/009-subv
On 2018/03/17 22:23, Goffredo Baroncelli wrote:
> On 03/15/2018 09:13 AM, Misono, Tomohiro wrote:
>> This is a preparetion work to allow normal user to call
>> "subvolume list/show".
>>
>> Signed-off-by: Tomohiro Misono
>> ---
>> btrfs-list.c
On 2018/03/17 22:23, Goffredo Baroncelli wrote:
> On 03/15/2018 09:15 AM, Misono, Tomohiro wrote:
>> Allow normal user to call "subvolume list/show" by using 3 new
>> unprivileged ioctls (BTRFS_IOC_GET_SUBVOL_INFO,
>> BTRFS_IOC_GET_SUBVOL_ROOTREF and BTRFS_IOC_INO_LO
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_BACK
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
---
fs/btrfs/ioctl.c | 118 +
Add unprivileged ioctl BTRFS_IOC_GET_SUBVOL_ROOTREF which
returns ROOT_REF information of the subvolume containing this inode.
The min id of root ref's subvolume to be searched is specified by
min_id in struct btrfs_ioctl_get_subvol_rootref_args.
If there are more root refs than BTRFS_MAX_ROOTREF_
Add unprivileged version of ino_lookup ioctl BTRFS_IOC_INO_LOOKUP_USER
to allow normal users to call "btrfs subvololume list/show" etc. in
combination with BTRFS_IOC_GET_SUBVOL_INFO/BTRFS_IOC_GET_SUBVOL_ROOTREF.
This can be used like BTRFS_IOC_INO_LOOKUP but the argument is
different. This is bec
changelog:
v2 -> v3
- use get_euid() to check the caller's privilege (and remove 3rd patch)
- improve error handling
v1 -> v2
- add independent error handling patch (1st patch)
- reimplement according to ioctl change
- various cleanup
===
This RFC implements user version of "subvolume l
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 user version of "btrfs subvolume list" etc.
Signed-off-by: Tomohiro Misono
---
ioctl.h | 86
After btrfs_list_subvols() is called, root_lookup may hold some allocated
memory area even if the function fails.
Therefore rb_free_nodes() should be called.
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/btrf
O_NOATIME flag requires effective UID of process matches file's owner
or has CAP_FOWNER capabilities. Fallback to open without O_NOATIME flag
so that normal user can also call find_mount_root().
This is a preparation work to allow normal user to call "subvolume show".
Signed-off-by: Tomohiro Miso
This is a preparetion work to allow normal user to call
"subvolume list/show".
Signed-off-by: Tomohiro Misono
---
btrfs-list.c | 16 +---
btrfs-list.h | 7 ---
cmds-subvolume.c | 6 +++---
utils.c | 10 +-
4 files changed, 21 insertions(+), 18 deletions
Test user 'progs-test' will be used to test the behavior of normal user.
In order to pass this check, add the user by "useradd -M progs-test".
Note that progs-test should not have root privileges.
Signed-off-by: Tomohiro Misono
---
tests/common | 10 ++
1 file changed, 10 insertions(+)
Signed-off-by: Tomohiro Misono
---
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-subvolume-list/test.sh
b/tests/cli-tests/009-subv
Allow normal user to call "subvolume list/show" by using 3 new
unprivileged ioctls (BTRFS_IOC_GET_SUBVOL_INFO,
BTRFS_IOC_GET_SUBVOL_ROOTREF and BTRFS_IOC_INO_LOOKUP_USER).
Note that for root, "subvolume list" returns all the subvolume in the
filesystem by default, but for normal user, it returns s
Currently, the top-level subvolume lacks the UUID. As a result, both
non-snapshot subvolume and snapshot of top-level subvolume do not have
Parent UUID and cannot be distinguisued. Therefore "fi show" of
top-level lists all the subvolumes which lacks the UUID in
"Snapshot(s)" filed. Also, it lacks
On 2018/03/20 2:09, Goffredo Baroncelli wrote:
> On 03/19/2018 08:32 AM, Misono, Tomohiro wrote
[snip]
>> static void print_subvolume_column(struct root_info *subv,
>> enum btrfs_list_column_enum column)
>> {
>> @@ -1492,19 +1800
Deletion of subvolume by non-privileged user is completely restricted
by default because we can delete a subvolume even if it is not empty
and may cause data loss. In other words, when user_subvol_rm_allowed
mount option is used, a user can delete a subvolume containing the
directory which cannot b
Signed-off-by: Tomohiro Misono
---
fs/btrfs/ctree.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index da308774b8a4..8f59cb20dd4c 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -86,9 +86,9 @@ struct btrfs_ordered_sum;
*/
#def
On 2018/03/21 16:46, Nikolay Borisov wrote:
>
>
> On 20.03.2018 22:06, Goffredo Baroncelli wrote:
>> On 03/20/2018 07:45 AM, Misono, Tomohiro wrote:
>>> Deletion of subvolume by non-privileged user is completely restricted
>>> by default because we can delete a
On 2018/03/22 2:48, David Sterba wrote:
> On Mon, Mar 19, 2018 at 05:16:42PM +0900, Misono, Tomohiro wrote:
>> Currently, the top-level subvolume lacks the UUID. As a result, both
>> non-snapshot subvolume and snapshot of top-level subvolume do not have
>> Parent UUID and ca
Currently, the top-level subvolume lacks the UUID. As a result, both
non-snapshot subvolume and snapshot of top-level subvolume do not have
Parent UUID and cannot be distinguisued. Therefore "fi show" of
top-level lists all the subvolumes which lacks the UUID in
"Snapshot(s)" filed. Also, it lacks
On 2018/03/20 17:50, Qu Wenruo wrote:
>
>
> On 2018年03月20日 14:47, Misono, Tomohiro wrote:
>>
>> Signed-off-by: Tomohiro Misono
>
> Reviewed-by: Qu Wenruo
>
> BTW this reminds me that, btrfs-progs is still using BTRFS_CRC32_SIZE
> macro which the original c
The kernel code no longer has BTRFS_CRC32_SIZE and only uses
btrfs_csum_sizes[]. So, update the progs code as well.
Suggested-by: Qu Wenruo
Signed-off-by: Tomohiro Misono
---
convert/common.c | 2 +-
convert/main.c | 2 +-
ctree.h | 3 +--
image/main.c | 4 ++--
mkfs/common.c
This patch changes the behavior of rmdir(2) to allow it to delete
an empty subvolume.
In order to do that the core logic of subvolume deletion is moved from
ioctl.c to inode.c and named as btrfs_delete_subvolume(), which is
also called in the btrfs_rmdir() if a directory is an empty subvolume.
No
On 2018/03/23 18:14, Qu Wenruo wrote:
>
>
> On 2018年03月23日 16:20, Misono Tomohiro wrote:
>> The kernel code no longer has BTRFS_CRC32_SIZE and only uses
>> btrfs_csum_sizes[]. So, update the progs code as well.
>>
>> Suggested-by: Qu Wenruo
>> Signed-off-
On 2018/03/23 18:09, Nikolay Borisov wrote:
>
>
> On 23.03.2018 10:28, Misono Tomohiro wrote:
>> This patch changes the behavior of rmdir(2) to allow it to delete
>> an empty subvolume.
>>
>> In order to do that the core logic of subvolume deletion is moved fro
changelog:
v1 -> v2 ... split the patch to hopefully make review easier
1st patch is a preparation work just moving the declaration of
may_destroy_subvol().
2nd patch is the main part. New function btrfs_delete_subvolume() is
introduced and used in btrfs_rmdir() when a direcoty is an empty
subv
This is a preparation work to allow rmdir(2) to delete a subvolume.
Signed-off-by: Tomohiro Misono
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/inode.c | 54 ++
fs/btrfs/ioctl.c | 54 --
3 files chan
Use btrfs_delete_subvolume() in btrfs_ioctl_snap_destroy() too to
cleanup the code. Call of d_delete() is still required since
btrfs_delete_subvolume() does not call it (for rmdir(2), vfs layer later
calls it).
As a result, btrfs_unlink_subvol() and may_destroy_subvol()
become static functions. No
This patch changes the behavior of rmdir(2) to allow it to delete
an empty subvolume by default, unless it is not a default subvolume
and send is not in progress.
New function btrfs_delete_subvolume() is almost equal to the second half
of btrfs_ioctl_snap_destroy(). This function requires inode_lo
current devel branch of btrfs-progs (github) occasionally fails at misc-test
006:
(kernel is 4.16.0-rc7)
==
$ sudo make test-misc TEST=006\*
[LD] fssum
[TEST] misc-tests.sh
[TEST/misc] 006-image-on-missing-device
/usr/data/src/btrfs-progs/tests//common: line 177: 10819 Abo
On 2018/03/26 17:51, Nikolay Borisov wrote:
>
>
> On 26.03.2018 11:28, Misono Tomohiro wrote:
>> This is a preparation work to allow rmdir(2) to delete a subvolume.
>>
>> Signed-off-by: Tomohiro Misono
>> ---
>> fs/btrfs/c
On 2018/03/27 21:39, Nikolay Borisov wrote:
>
>
> On 26.03.2018 11:30, Misono Tomohiro wrote:
>> This patch changes the behavior of rmdir(2) to allow it to delete
>> an empty subvolume by default, unless it is not a default subvolume
>> and send is not in p
On 2018/03/28 23:50, David Sterba wrote:
> On Wed, Mar 28, 2018 at 10:55:56AM +0900, Misono Tomohiro wrote:
>> current devel branch of btrfs-progs (github) occasionally fails at misc-test
>> 006:
>> (kernel is 4.16.0-rc7)
>
> Can you please also open an issue on github
v1->v2
These were sent several months ago, just rebased to current devel branch.
Patch 1 and 2 aims to fix the "fi du" to include the information of "fi df"
even when running without root privilege.
Patch 3 is an independent cleanup.
Tomohiro Misono (3):
btrfs-progs: fi usage: change warning
Although per device usage cannot be shown without root privilege,
per profile usage can be shown.
To achieve this, we just basically need to remove the check of nullness
of chunkinfo in print_filesystem_usage_by_chunk(), because other
functions except print_unused() properly handles chunkinfo by
c
"fi usage" shows the warning "RAID5/6 numbers will be incorrect" when
running without root privilege even if raid5/6 is not used. What
happens is it cannot get the per device profile usage info, so change
the message more appropriately.
Reviewed-by: Qu Wenruo
Signed-off-by: Tomohiro Misono
---
Since BTRFS_IOC_FS_INFO does not require root privilege, there is no
need to check EPERM error.
Reviewed-by: Qu Wenruo
Signed-off-by: Tomohiro Misono
---
cmds-fi-usage.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
index 2d45b3bb..5ce87a37 100644
-
92 gen 696884 top level 257 path a
> ID 593 gen 696885 top level 592 path a/a1
> ID 594 gen 696885 top level 593 path a/a1/a2
> ID 595 gen 0 top level 257 path b
>
>
> ghigo@venice:/tmp$ /home/ghigo/btrfs/btrfs-progs/btrfs sub show a
> tmp/a
> Name: a
This is a preparation work to allow rmdir(2) to delete a subvolume.
Signed-off-by: Tomohiro Misono
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/inode.c | 54 ++
fs/btrfs/ioctl.c | 54 --
3 files chan
changelog:
v2 -> v3 ... use if-else block instead of two if blocks and
add Tested-by tag in 2nd patch
v1 -> v2 ... split the patch to hopefully make review easier
Note: I will send a xfstest if this series is merged.
1st patch is a preparation work just moving the declaration
This patch changes the behavior of rmdir(2) to allow it to delete
an empty subvolume by default, unless it is not a default subvolume
and send is not in progress.
New function btrfs_delete_subvolume() is almost equal to the second half
of btrfs_ioctl_snap_destroy(). This function requires inode_lo
Use btrfs_delete_subvolume() in btrfs_ioctl_snap_destroy() too to
cleanup the code. Call of d_delete() is still required since
btrfs_delete_subvolume() does not call it (for rmdir(2), vfs layer later
calls it).
As a result, btrfs_unlink_subvol() and may_destroy_subvol()
become static functions. No
On 2018/03/29 16:53, Omar Sandoval wrote:
> From: Omar Sandoval
>
> Since "btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE",
> the top-level subvolume has a non-zero UUID, ctime, and otime. Fix the
> subvolume_info() test to not check for zero.
Sorry, I didn't notice this.
I chec
mkfs-test 016 "rootdir-bad-symbolic-link" fails when selinux is enabled.
This is because add_xattr_item() uses getxattr() and tries to follow a
bad symbolic link for selinux item, which causes ENOENT error.
The line above already uses llistxattr() for getting list of xattr in
order not to follow a
On 2018/04/06 23:46, David Sterba wrote:
> On Fri, Mar 30, 2018 at 03:16:47PM +0900, Misono Tomohiro wrote:
>> This patch changes the behavior of rmdir(2) to allow it to delete
>> an empty subvolume by default, unless it is not a default subvolume
>> and send is not in progres
changelog:
v3 -> v4 ... Reorganize patches and updates commit log.
No code change in total
v2 -> v3 ... Use if-else block instead of two if blocks and
add Tested-by tag in 2nd patch
v1 -> v2 ... Split the patch to hopefully make review easier
Note: I will send
This is a preparation work to refactor btrfs_ioctl_snap_destroy()
and to allow rmdir(2) to delete an empty subvolume.
Signed-off-by: Tomohiro Misono
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/inode.c | 54 ++
fs/btrfs/ioctl.c | 54 --
1 - 100 of 366 matches
Mail list logo