[PATCH v2 1/3] fstests: log-writes: Add support to output human readable flags

2018-03-06 Thread Qu Wenruo
Also change the flag numeric output to hex. Signed-off-by: Qu Wenruo --- v2: Also output unknown flags in hex --- src/log-writes/log-writes.c | 70 - 1 file changed, 63 insertions(+), 7 deletions(-) diff --git

Re: ERROR: unsupported checksum algorithm 35355

2018-03-06 Thread Qu Wenruo
Here is the fixed superblock. csum type and incompat flags get fixed. I'm not sure if they are the only problems, but I strongly recommend to run btrfs check before mount. Thanks, Qu On 2018年03月06日 10:22, Ken Swenson wrote: > Hi Qu, > > attached is the binary super block as requested. > >

[RFC PATCH 7/7] btrfs-porgs: test: Add cli-test/009 to check subvolume list for both root and normal user

2018-03-06 Thread Misono, Tomohiro
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

[RFC PATCH 6/7] btrfs-progs: test: Add helper function to check if test user exists

2018-03-06 Thread Misono, Tomohiro
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 ++

[RFC PATCH 5/7] btrfs-progs: sub list: Allow normal user to call "subvolume list/show"

2018-03-06 Thread Misono, Tomohiro
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

Re: [PATCH 1/3] fstests: log-writes: Add support to output human readable flags

2018-03-06 Thread Amir Goldstein
On Tue, Mar 6, 2018 at 10:15 AM, Qu Wenruo wrote: > Also change the flag numeric output to hex. > > Signed-off-by: Qu Wenruo > --- > src/log-writes/log-writes.c | 70 > - > 1 file changed, 63 insertions(+), 7

[RFC PATCH 4/7] btrfs-progs: fallback to open without O_NOATIME flag in, find_mount_root()

2018-03-06 Thread Misono, Tomohiro
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

[PATCH 3/7] btrfs-progs: sub list: Pass specified path down to btrfs_list_subvols()

2018-03-06 Thread Misono, Tomohiro
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

[RFC PATCH 2/7] btrfs-progs: sub list: Add helper function which checks the permission for tree search ioctl

2018-03-06 Thread Misono, Tomohiro
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

[RFC PATCH 1/7] btrfs-progs: Add 2 definitions of new unprivileged ioctl

2018-03-06 Thread Misono, Tomohiro
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,

[RFC PATCH 0/7] btrfs-progs: Allow normal user to call "subvolume list/show"

2018-03-06 Thread Misono, Tomohiro
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

[PATCH 1/2] btrfs: Add unprivileged subvolume search ioctl

2018-03-06 Thread Misono, Tomohiro
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

[PATCH 0/2] btrfs: Add two new unprivileged ioctls to allow normal users to call "sub list/show" etc.

2018-03-06 Thread Misono, Tomohiro
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

[PATCH 2/2] btrfs: Add unprivileged version of ino_lookup ioctl

2018-03-06 Thread Misono, Tomohiro
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

[PATCH 1/3] fstests: log-writes: Add support to output human readable flags

2018-03-06 Thread Qu Wenruo
Also change the flag numeric output to hex. Signed-off-by: Qu Wenruo --- src/log-writes/log-writes.c | 70 - 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/src/log-writes/log-writes.c b/src/log-writes/log-writes.c index

[PATCH 2/3] fstests: log-writes: Add support for METADATA flag

2018-03-06 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- src/log-writes/log-writes.c | 3 ++- src/log-writes/log-writes.h | 9 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/log-writes/log-writes.c b/src/log-writes/log-writes.c index 66fad350..d755194a 100644 ---

[PATCH 3/3] fstests: btrfs: Add test case to check v1 space cache corruption

2018-03-06 Thread Qu Wenruo
There are some btrfs corruption report in mail list for a while, although such corruption is pretty rare and almost impossible to reproduce, with dm-log-writes we found it's highly related to v1 space cache. Unlike journal based filesystems, btrfs completely rely on metadata CoW to protect itself

<    1   2