Fwd: [PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

2017-09-11 Thread Misono, Tomohiro
Hello, Does anyone have a comment on this? Regards, Tomohiro Forwarded Message Subject: [PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag Date: Wed, 30 Aug 2017 16:33:16 +0900 From: Misono, Tomohiro <misono.tomoh...@jp.fujitsu.com> To: linux-btrfs@vger.kernel.org Cur

[PATCH] btrfs-progs: cleanup whitespaces of btrfs-completion

2017-09-11 Thread Misono, Tomohiro
Clean up spaces and use only tabs. No functional change. Signed-off-by: Tomohiro Misono --- btrfs-completion | 188 +++ 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/btrfs-completion

Re: btrfs-progs: suggestion of removing --commit-after option of subvol delete

2017-09-19 Thread Misono, Tomohiro
On 2017/09/19 23:48, David Sterba wrote: > On Tue, Sep 19, 2017 at 04:50:04PM +0900, Misono, Tomohiro wrote: >> I read the code of "subvolume delete" and found that --commit-after option is >> not working well. >> >> Since it issues BTRFS_IOC_START/W

btrfs-progs: suggestion of removing --commit-after option of subvol delete

2017-09-19 Thread Misono, Tomohiro
Hello, I read the code of "subvolume delete" and found that --commit-after option is not working well. Since it issues BTRFS_IOC_START/WAIT_SYNC to the last fd (of directory containing the last deleted subvolume), 1. sync operation affects only the last fd's filesystem. ("subvolume delete"

[PATCH] btrfs-progs: subvolume: outputs message only when operation succeeds

2017-09-19 Thread Misono, Tomohiro
"btrfs subvolume create/delete" outputs the message of "Create/Delete subvolume ..." even when an operation fails. Since it is confusing, let's outputs the message only when an operation succeeds. Signed-off-by: Tomohiro Misono --- cmds-subvolume.c | 8

Re: [PATCH v2 3/3] btrfs: introduce new btrfs_mount()

2017-09-22 Thread Misono, Tomohiro
> (1) parse subvol id related options for later use in mount_subtree() > (3) return by calling mount_subtree() Sorry, this is not mount_subtree(), but mount_subvol(). Thanks, Tomohiro -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

Re: btrfs-progs: suggestion of removing --commit-after option of subvol delete

2017-09-20 Thread Misono, Tomohiro
On 2017/09/20 23:21, Qu Wenruo wrote: > > > On 2017年09月20日 22:03, David Sterba wrote: >> On Wed, Sep 20, 2017 at 08:22:54AM +0800, Qu Wenruo wrote: >>> The costly part will be tracking the filesystems of subvolumes. >>> We must do it for each subvolume and batch them to address the final >>>

[PATCH v2 0/3] btrfs: cleanup mount path

2017-09-21 Thread Misono, Tomohiro
Summary: Cleanup mount path by avoiding calling btrfs_mount() twice. No functional change. change to v2: split the patch into three parts. Long Explanation: btrfs uses mount_subtree() to mount a subvolume directly. This function needs a vfsmount* of device's root (/), which is a return value of

[PATCH v2 3/3] btrfs: introduce new btrfs_mount()

2017-09-22 Thread Misono, Tomohiro
Introduce new btrfs_mount() using previous setups. This will do: (1) parse subvol id related options for later use in mount_subtree() (2) mount device's root by calling vfs_kern_mount() with btrfs_root_fs_type. As a result, mount_root() is called (3) return by calling mount_subtree() The

[PATCH v2 2/3] btrfs: split parse_early_options() in two

2017-09-21 Thread Misono, Tomohiro
Extract the part related to subvol option from parse_early_options() and move it to new parse function (parse_subvol_options()). This is because mount_root() doesn't need to handle subvol options. Signed-off-by: Tomohiro Misono --- fs/btrfs/super.c | 75

[PATCH v2 1/3] btrfs: change btrfs_mount() to mount_root()

2017-09-21 Thread Misono, Tomohiro
Remove subvol related part from btrfs_mount() and change its name to mount_root(). Also, file_system_type having mount_root() is defined for the third patch. New btrfs_mount() will be introduced in the third patch. Signed-off-by: Tomohiro Misono ---

[PATCH] btrfs: cleanup mount path

2017-09-18 Thread Misono, Tomohiro
Summary: Cleanup mount path by avoiding calling btrfs_mount() twice. This is for more understandable code and no functional change. Explanation: btrfs uses mount_subtree() to mount a subvolume directly. This function needs a vfsmount* of device's root (/), which is a return value of

Re: [PATCH v2] btrfs-progs: subvol: change subvol set-default to also accept subvol path

2017-10-04 Thread Misono, Tomohiro
On 2017/10/05 3:07, David Sterba wrote: > On Tue, Oct 03, 2017 at 08:57:52AM +0900, Misono, Tomohiro wrote: >> On 2017/10/02 18:01, Hugo Mills wrote: >>> On Mon, Oct 02, 2017 at 11:39:05AM +0300, Andrei Borzenkov wrote: >>>> On Mon, Oct 2, 2017 at 11:19 AM, Mison

Re: [PATCH v2] btrfs-progs: subvol: change subvol set-default to also accept subvol path

2017-10-02 Thread Misono, Tomohiro
On 2017/10/02 18:01, Hugo Mills wrote: > On Mon, Oct 02, 2017 at 11:39:05AM +0300, Andrei Borzenkov wrote: >> On Mon, Oct 2, 2017 at 11:19 AM, Misono, Tomohiro >> <misono.tomoh...@jp.fujitsu.com> wrote: >>> This patch changes "subvol set-default

[PATCH v3 0/2] btrfs-progs: doc: update btrfs device remove

2017-10-15 Thread Misono, Tomohiro
This updates help/doc of "btrfs device remove". First patch adds the explanation that delete is the alias of remove to help message. Second patch adds the description of "remove missing", which is currently only written in wikipage, and example of device removal. v1->v2: split the patch and

Re: [PATCH v2 3/3] btrfs-progs: device: add remove missing-all

2017-10-15 Thread Misono, Tomohiro
On 2017/10/16 12:30, Anand Jain wrote: > > > On 10/13/2017 01:27 PM, Duncan wrote: >> Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted: >> >>> Add 'btrfs remove missing-all' to remove all the missing devices at once >>> f

[PATCH v3 2/2] btrfs-progs: doc: add description of missing and example of device remove

2017-10-15 Thread Misono, Tomohiro
This patch updates help/document of "btrfs device remove" in two points: 1. Add explanation of 'missing' for 'device remove'. This is only written in wikipage currently. (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices) 2. Add example of device removal in the man

[PATCH v3 1/2] btrfs-progs: device: add description of alias to help message

2017-10-15 Thread Misono, Tomohiro
State the 'delete' is the alias of 'remove' as the man page says. Signed-off-by: Tomohiro Misono Reviewed-by: Satoru Takeuchi --- cmds-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-device.c

Re: [PATCH v2 3/3] btrfs-progs: device: add remove missing-all

2017-10-15 Thread Misono, Tomohiro
On 2017/10/13 14:27, Duncan wrote: > Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted: > >> Add 'btrfs remove missing-all' to remove all the missing devices at once >> for improving usability. >> >> Example: >> sudo mkfs.btrfs -f -d raid

[PATCH v3] btrfs-progs: change subvol set-default to also accept subvol path

2017-10-05 Thread Misono, Tomohiro
This patch changes "subvol set-default" to also accept the subvolume path for convenience. This is the one of the issue on github: https://github.com/kdave/btrfs-progs/issues/35 If there are two args, they are assumed as subvol id and path to the fs (the same as current behavior), and if there

Re: [PATCH v3 2/2] btrfs-progs: doc: add description of missing and example of device remove

2017-10-16 Thread Misono, Tomohiro
On 2017/10/16 18:22, Nikolay Borisov wrote: > > > On 16.10.2017 07:56, Misono, Tomohiro wrote: >> This patch updates help/document of "btrfs device remove" in two points: >> >> 1. Add explanation of 'missing' for 'device remove'. This is only >&g

Re: [PATCH] btrfs/029: fix wrong usage of name filter

2017-08-30 Thread Misono, Tomohiro
Sorry, this patch contains leading spaces, I will resend this soon. On 2017/08/30 11:44, Misono, Tomohiro wrote: > btrfs/029 uses _filter_testdirs() to filter the name of $TEST_DIR and > $SCRATCH_MNT directory. > > In this function, it calls both _filter_test_dir and _fi

[PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

2017-08-30 Thread Misono, Tomohiro
Currently, "btrfs quota enable" would fail after "btrfs quota disable" on the first time with syslog output "qgroup_rescan_init failed with -22", but it would succeed on the second time. When "quota disable" is called, BTRFS_FS_QUOTA_DISABLING flag bit will be set in fs_info->flags in

[PATCH] btrfs/029: fix wrong usage of name filter

2017-08-30 Thread Misono, Tomohiro
btrfs/029 uses _filter_testdirs() to filter the name of $TEST_DIR and $SCRATCH_MNT directory. In this function, it calls both _filter_test_dir and _filter_scratch concatenated by pipe. Therefore if $TEST_DIR is a prefix of $SCRATCH_MNT, this filter function gives wrong filtered name for

Re: [PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

2017-08-30 Thread Misono, Tomohiro
Sorry, this patch contains leading spaces, I will resend this soon. On 2017/08/30 10:51, Misono, Tomohiro wrote: > Currently, "btrfs quota enable" would fail after "btrfs quota disable" on > the first time with syslog output "qgroup_rescan_init failed wi

[PATCH] btrfs-progs: update btrfs-completion

2017-09-10 Thread Misono, Tomohiro
This patch updates btrfs-completion: - add "filesystem du" and "rescure zero-log" - restrict _btrfs_mnts to show btrfs type only - add more completion in last case statements (This file contains both spaces/tabs and may need cleanup.) Signed-off-by: Tomohiro Misono

[PATCH] btrfs-progs: test: add new test for inspect-internal rootid

2017-09-04 Thread Misono, Tomohiro
This new test checks inspect-internal rootid - handle path to subvolume/directory/file as an argument - get different id for each subvolume - get the expected id for each file/directory (i.e. the same as containing subvolume) Signed-off-by: Tomohiro Misono

[PATCH 2/2] btrfs-progs: test: fix name generation not to contain trailing spaces

2017-09-04 Thread Misono, Tomohiro
First patch causes test-convert fails. This is because generate_dataset() creates a name containing trailing spaces for "slow_symlink" type, and cause getfacl error in convert_test_perm(). (This is not noticed since original run_check_stdout() throws away the error.) Fix this by use space for

[PATCH 1/2] btrfs-progs: test: fix run_check_stdout() call _fail()

2017-09-04 Thread Misono, Tomohiro
run_check_stdout() uses "... | tee ... || _fail". However, since tee won't fail, _fail() is not called even if first command fails. Fix this by checking PIPESTATUS in the end. Signed-off-by: Tomohiro Misono --- tests/common | 7 +-- 1 file changed, 5

[PATCH v2] btrfs-progs: test: add new test for inspect-internal rootid

2017-09-06 Thread Misono, Tomohiro
This new test checks inspect-internal rootid - handle path to subvolume/directory/file as an argument - get different id for each subvolume - get the expected id for each file/directory (i.e. the same as containing subvolume) Signed-off-by: Tomohiro Misono

Re: [PATCH 3/4] btrfs-progs: change seen_fsid to hold fd and DIR*

2017-09-26 Thread Misono, Tomohiro
On 2017/09/26 22:08, Qu Wenruo wrote: > > > On 2017年09月26日 13:45, Misono, Tomohiro wrote: >> Change seen_fsid to hold fd and DIR* in order to keep access to each fs. >> This will be used for 'subvol delete --commit-after'. > > It is already quite good, good enough for

[PATCH v2 3/5] btrfs-progs: move seen_fsid to util.c

2017-09-26 Thread Misono, Tomohiro
Make is_seen_fsid()/add_seen_fsid()/free_seen_fsid() to common functions. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo --- cmds-filesystem.c | 88

[PATCH v2 2/5] btrfs-progs: move get_fsid() to util.c

2017-09-26 Thread Misono, Tomohiro
Make get_fsid() to a common function. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo --- cmds-property.c | 30 -- utils.c | 31

[PATCH v2 1/5] btrfs-progs: subvol: exchange subvol del --commit-after and --commit-each

2017-09-26 Thread Misono, Tomohiro
Current code is reversed in --commit-after and --commit-each operation. i.e. --commit-after means --commit-each actually. This patch fix this and also introduces enum type for more readable code. Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo

[PATCH v2 0/5] btrfs-progs: subvol: fix del --commit-after

2017-09-26 Thread Misono, Tomohiro
Fix subvol del --commit-after to work properly: - SYNC ioctl will be issued even when last delete is failed - SYNC ioctl will be issued on each file system only once in the end To achieve this, each deleted subvol's (parent's) fsid is checked each time. If the fsid is seen for the first time,

[PATCH v2 4/5] btrfs-progs: change seen_fsid to hold fd and DIR*

2017-09-26 Thread Misono, Tomohiro
Change seen_fsid to hold fd and DIR* in order to keep access to each fs. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo --- cmds-filesystem.c | 4 ++-- utils.c | 6

[PATCH v2 5/5] btrfs-progs: subvol: fix subvol del --commit-after

2017-09-26 Thread Misono, Tomohiro
Fix subvol del --commit-after to work properly: - SYNC ioctl will be issued even when last delete is failed - SYNC ioctl will be issued on each file system only once in the end To achieve this, get_fsid() and add_seen_fsid() is called after each delete to keep only one fd for each fs. In the

[PATCH 0/4] btrfs-progs: subvol: fix del --commit-after

2017-09-25 Thread Misono, Tomohiro
Fix subvol del --commit-after to work properly: - SYNC ioctl will be issued even when last delete is failed - SYNC ioctl will be issued on each file system only once in the end To achieve this, each deleted subvol's (parent's) fsid is checked each time. If the fsid is seen for the first time,

[PATCH 2/4] btrfs-progs: move seen_fsid to util.c

2017-09-25 Thread Misono, Tomohiro
Make is_seen_fsid()/add_seen_fsid()/free_seen_fsid() to common functions. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono --- cmds-filesystem.c | 88 --- utils.c |

[PATCH 1/4] btrfs-progs: move get_fsid() to util.c

2017-09-25 Thread Misono, Tomohiro
Make get_fsid() to a common function. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono --- cmds-property.c | 30 -- utils.c | 31 +++ utils.h | 1 + 3

[PATCH] btrfs-progs: subvol: change subvol set-default to also accept subvol path

2017-10-02 Thread Misono, Tomohiro
This patch changes "subvol set-default" to also accept the subvolume path for convenience. This is the one of the issue on github: https://github.com/kdave/btrfs-progs/issues/35 If there are two args, they are assumed as subvol id and path to the fs (the same as current behavior), and if there

Re: [PATCH] btrfs-progs: subvol: change subvol set-default to also accept subvol path

2017-10-02 Thread Misono, Tomohiro
I rethink this and conclude that we should only allow the absolute path to the subvolume in order to prevent setting wrong filesystem by mistake when multiple filesystems are used. I will submit the patch again and please ignore this. Regards, Tomohiro On 2017/10/02 15:25, Misono, Tomohiro

[PATCH v2] btrfs-progs: subvol: change subvol set-default to also accept subvol path

2017-10-02 Thread Misono, Tomohiro
This patch changes "subvol set-default" to also accept the subvolume path for convenience. This is the one of the issue on github: https://github.com/kdave/btrfs-progs/issues/35 If there are two args, they are assumed as subvol id and path to the fs (the same as current behavior), and if there

[PATCH] btrfs-progs: misc-test: use raid1 for data to enable mount with -o degraded

2017-10-03 Thread Misono, Tomohiro
kernel 4.14 introduces new function for checking if all chunks is ok for mount with -o degraded option. commit 21634a19f646 ("btrfs: Introduce a function to check if all chunks a OK for degraded rw mount") As a result, raid0 profile cannot be mounted with -o degraded on 4.14. This causes

[PATCH] btrfs-progs: doc: update help/document of btrfs device remove

2017-10-03 Thread Misono, Tomohiro
This patch updates help/document of "btrfs device remove" in two points: 1. Add explanation of 'missing' for 'device remove'. This is only written in wikipage currently. (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices) 2. Add example of device removal in the man

[PATCH 3/4] btrfs-progs: change seen_fsid to hold fd and DIR*

2017-09-25 Thread Misono, Tomohiro
Change seen_fsid to hold fd and DIR* in order to keep access to each fs. This will be used for 'subvol delete --commit-after'. Signed-off-by: Tomohiro Misono --- cmds-filesystem.c | 4 ++-- utils.c | 6 +- utils.h | 5 - 3 files

[PATCH 4/4] btrfs-progs: subvol: fix subvol del --commit-after

2017-09-25 Thread Misono, Tomohiro
Fix subvol del --commit-after to work properly: - SYNC ioctl will be issued even when last delete is failed - SYNC ioctl will be issued on each file system only once in the end To achieve this, get_fsid() and add_seen_fsid() is called after each delete to keep only one fd for each fs. In the

[PATCH 1/4] btrfs: add mount_root() and new file_system_type

2017-09-25 Thread Misono, Tomohiro
Add mount_root() and new file_system_type for preparation of cleanup of btrfs_mount(). Code path is not changed yet. mount_root() is almost the same as current btrfs_mount(), but doesn't have subvolume related part. Signed-off-by: Tomohiro Misono ---

[PATCH v3 0/4] btrfs: cleanup mount path

2017-09-25 Thread Misono, Tomohiro
Summary: Cleanup mount path by avoiding calling btrfs_mount() twice. No functional change. See below for longer explanation. Changelog: v3: Reorganized patches again into four and added comments to the source. Each patch can be applied and compiled while maintaining functionality. The first

[PATCH 2/4] btrfs: cleanup btrfs_mount() using mount_root()

2017-09-25 Thread Misono, Tomohiro
Cleanups btrfs_mount() by using mount_root(). This avoids getting btrfs_mount() called twice in mount path. Old btrfs_mount() will do: 0. VFS layer calls vfs_kern_mount() with registered file_system_type (for btrfs, btrfs_fs_type). btrfs_mount() is called on the way. 1.

[PATCH 4/4] btrfs: remove unused setup_root_args()

2017-09-25 Thread Misono, Tomohiro
Since setup_root_args() is not used anymore, just remove it. Signed-off-by: Tomohiro Misono --- fs/btrfs/super.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 7edd74d..f589c5b

[PATCH 3/4] btrfs: split parse_early_options() in two

2017-09-25 Thread Misono, Tomohiro
Now parse_early_options() is used by both btrfs_mount() and mount_root(). However, the former only needs subvol related part and the latter needs the others. Therefore extract the subvol related parts from parse_early_options() and move it to new parse function (parse_subvol_options()).

Re: [PATCH] btrfs-progs: doc: fix btrfs-inspect-internal rootid doc

2017-08-24 Thread Misono, Tomohiro
On 2017/08/25 2:37, David Sterba wrote: On Thu, Aug 24, 2017 at 04:39:53PM +0900, Misono, Tomohiro wrote: "btrfs inspect-internal rootid " rejects a file to be specified in the implementation. Therefore change "file or directory" to "directory" in the doc. Is th

Re: [PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
Sorry, this patch's encoding is wrong. Please ignore this and I will resend the patch. On 2017/08/24 13:03, Misono, Tomohiro wrote: I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by

[PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by: Tomohiro Misono --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c

[PATCH 1/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
I found some btrfs commands options are not working because of inappropriate getopt_long() setting. This fixes "btrfs check -Q/-E" Signed-off-by: Tomohiro Misono ---  cmds-check.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c

[PATCH 2/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
This fixes "btrfs receive -E" Signed-off-by: Tomohiro Misono --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index 72e9c8f..e584cef 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -1277,7

[PATCH 3/3] btrfs-progs: fix option handling for some commands

2017-08-23 Thread Misono, Tomohiro
This fixes "btrfs inspect-internal dump-super --bytenr" Signed-off-by: Tomohiro Misono --- cmds-inspect-dump-super.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index 98e0270..c7afd80 100644

[PATCH] btrfs-progs: change document in accordance with usage info

2017-08-24 Thread Misono, Tomohiro
Usage info of "btrfs check" shows "-Q|--qgroup-report" (and first patch enables -Q), but the document only shows "--qgroup-report". Therefore add -Q to the doc. Signed-off-by: Tomohiro Misono --- Documentation/btrfs-check.asciidoc | 2 +- 1 file changed, 1

[PATCH] btrfs-progs: doc: fix btrfs-inspect-internal rootid doc

2017-08-24 Thread Misono, Tomohiro
"btrfs inspect-internal rootid " rejects a file to be specified in the implementation. Therefore change "file or directory" to "directory" in the doc. Signed-off-by: Tomohiro Misono --- Documentation/btrfs-inspect-internal.asciidoc | 2 +- 1 file changed, 1

[PATCH] btrfs-progs: doc: add figure 1 to btrfs quota doc

2017-08-24 Thread Misono, Tomohiro
The document of btrfs quota is missing figure 1. I notice the body is copy of http://sensille.com/qgroups.pdf (whi ch is linked from https://btrfs.wiki.kernel.org/index.php/Quota_support), and insert the figure. Signed-off-by: Tomohiro Misono ---

Re: [PATCH] btrfs/029: fix wrong usage of name filter

2017-08-31 Thread Misono, Tomohiro
On 2017/08/31 16:33, Eryu Guan wrote: > On Thu, Aug 31, 2017 at 08:53:09AM +0900, Misono, Tomohiro wrote: >> On 2017/08/30 20:09, Eryu Guan wrote: >>> On Wed, Aug 30, 2017 at 04:38:16PM +0900, Misono, Tomohiro wrote: >>>> btrfs/029 uses _filter_testdirs() t

[PATCH] btrfs-progs: inspect-internal rootid: Allow a file to be specified

2017-09-03 Thread Misono, Tomohiro
Since cmd_inspect_rootid() calls btrfs_open_dir(), it rejects a file to be spcified. But as the document says, a file should be supported. This patch introduces btrfs_open_file_or_dir(), which is a counterpart of btrfs_open_dir(), to safely check and open btrfs file or directory. The original

Re: [PATCH] btrfs/029: fix wrong usage of name filter

2017-08-30 Thread Misono, Tomohiro
On 2017/08/30 20:09, Eryu Guan wrote: > On Wed, Aug 30, 2017 at 04:38:16PM +0900, Misono, Tomohiro wrote: >> btrfs/029 uses _filter_testdirs() to filter the name of $TEST_DIR and >> $SCRATCH_MNT directory. >> >> In this function, it calls both _filter_test_dir and _filt

[PATCH 1/2] Add new common filter function

2017-08-31 Thread Misono, Tomohiro
Several tests uses both _filter_test_dir and _filter_scratch concatenated by pipe to filter $TEST_DIR and $SCRATCH_MNT. However, this would fail if the shorter string is a substring of the other (like "/mnt" and "/mnt2"). This patch introduces new common filter function to safely call both

[PATCH 2/2] Use common filter function in several tests

2017-08-31 Thread Misono, Tomohiro
Use newly introduced common function to filter both $TEST_DIR and $SCRATCH_MNT. Signed-off-by: Tomohiro Misono --- common/filter | 2 +- tests/btrfs/029 | 11 +++ tests/generic/409 | 3 +-- tests/generic/410 | 3 +-- tests/generic/411 | 3 +-- 5

[PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag

2017-08-29 Thread Misono, Tomohiro
Currently, "btrfs quota enable" would fail after "btrfs quota disable" on the first time with syslog output "qgroup_rescan_init failed with -22", but it would succeed on the second time. When "quota disable" is called, BTRFS_FS_QUOTA_DISABLING flag bit will be set in fs_info->flags in

[PATCH] btrfs/029: fix wrong usage of name filter

2017-08-29 Thread Misono, Tomohiro
btrfs/029 uses _filter_testdirs() to filter the name of $TEST_DIR and $SCRATCH_MNT directory. In this function, it calls both _filter_test_dir and _filter_scratch concatenated by pipe. Therefore if $TEST_DIR is a prefix of $SCRATCH_MNT, this filter function gives wrong filtered name for

[PATCH v2 3/3] btrfs-progs: device: add remove missing-all

2017-10-10 Thread Misono, Tomohiro
Add 'btrfs remove missing-all' to remove all the missing devices at once for improving usability. Example: sudo mkfs.btrfs -f -d raid1 /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4 sudo wipefs -a /dev/sdb1 /dev/sdb3 sudo mount -o degraded /dev/sdb2 /mnt sudo btrfs filesystem show /mnt sudo btrfs

[PATCH v2 0/3] btrfs-progs: device: update btrfs device remove missing

2017-10-10 Thread Misono, Tomohiro
This series updates "btrfs device remove missing". Currently, the document lacks the description of "remove missing" which is written only in wikipage. First and second patch updates the documents. Third patch introduces new keyword "missing-all" to remove the all missing devices at once for

[PATCH v2 2/3] btrfs-progs: doc: add description of missing and example of device remove

2017-10-10 Thread Misono, Tomohiro
This patch updates help/document of "btrfs device remove" in two points: 1. Add explanation of 'missing' for 'device remove'. This is only written in wikipage currently. (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices) 2. Add example of device removal in the man

[PATCH v2 1/3] btrfs-progs: device: add description of alias to help message

2017-10-10 Thread Misono, Tomohiro
State the 'delete' is the alias of 'remove' as the man page says. Signed-off-by: Tomohiro Misono Reviewed-by: Satoru Takeuchi --- cmds-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-device.c

Re: [PATCH] btrfs-progs: doc: update help/document of btrfs device remove

2017-10-10 Thread Misono, Tomohiro
On 2017/10/11 6:22, Satoru Takeuchi wrote: > At Tue, 3 Oct 2017 17:12:39 +0900, > Misono, Tomohiro wrote: >> >> This patch updates help/document of "btrfs device remove" in two points: >> >> 1. Add explanation of 'missing' for 'device remove'. This

Re: [PATCH] btrfs-progs: change mans to describe the third copy of superblock

2017-10-19 Thread Misono, Tomohiro
On 2017/10/19 16:45, Satoru Takeuchi wrote: > Some tools can select which superblock these commands use by "-s " > option. Although this option says the valid values are 0-2, we can set 3 > if filesystem is very large. > Hello, Wiki says there are 4 superblocks. However in the implementation

[PATCH] btrfs-progs: test: add new cli-test for subvol get/set-default

2017-10-17 Thread Misono, Tomohiro
Add new test to check functionality of subvol get/set-default. Signed-off-by: Tomohiro Misono --- .../008-subvolume-get-set-default/test.sh | 45 ++ 1 file changed, 45 insertions(+) create mode 100755

[PATCH] btrfs-progs: mkfs: check the status of file at mkfs

2017-11-23 Thread Misono, Tomohiro
Currently, only the status of block devices is checked at mkfs, but we should also check for regular files whether they are already formatted or mounted to prevent overwrite accidentally. Device status is checked by test_dev_for_mkfs(). The part which is not related to block device is split from

[PATCH] btrfs-progs: mkfs: fix verbose value

2017-11-23 Thread Misono, Tomohiro
The value of 'verbose' is either 1 (default) or 0 (-q) and "verbose >= 2" will not be true. After fix this, we get something like: adding device /dev/sde id 2 adding device /dev/sdf id 3 during mkfs time when multiple devices are used. Signed-off-by: Tomohiro Misono

Re: [PATCH 6/9] btrfs-progs: mkfs: Fix regression preventing --rootdir to create file

2017-11-29 Thread Misono, Tomohiro
On 2017/11/29 18:16, Qu Wenruo wrote: > Commit 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs") > will try to check the file state before creating fs on it. > > The check is mostly fine for normal mkfs case, while for --rootdir > option, it's allowed to create new file if

[PATCH 3/3] btrfs-progs: fi usage: cleanup unneccessary permission error check

2017-11-29 Thread Misono, Tomohiro
Since BTRFS_IOC_FS_INFO does not require root privilege, there is no need to check EPERM error. 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 7bbc9896..b0721560

Re: [PATCH 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Misono, Tomohiro
On 2017/11/30 16:59, Qu Wenruo wrote: > > > On 2017年11月30日 15:52, Misono, Tomohiro wrote: >> "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when >> runnning without root privilege even if raid5/6 is not used. What >> happens is

[PATCH 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-29 Thread Misono, Tomohiro
"fi usage" shows the warning "RAID5/6 numbers will be incorrect" when runnning 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. Signed-off-by: Tomohiro Misono

[PATCH 0/3] Some fix for fi usage

2017-11-29 Thread Misono, Tomohiro
Patch 1 and 2 aims to fix the "fi du" to include the information of "fi df" even when runnning without root previlege. Patch 3 is a independent cleanup. Tomohiro Misono (3): btrfs-progs: fi usage: change warning message more appropriately btrfs-progs: fi usage: change to output more info

[PATCH v2 1/3] btrfs-progs: fi usage: change warning message more appropriately

2017-11-30 Thread Misono, Tomohiro
"fi usage" shows the warning "RAID5/6 numbers will be incorrect" when runnning 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. Signed-off-by: Tomohiro Misono

Re: [PATCH] btrfs: fix inconsistency during missing device rejoin

2017-12-04 Thread Misono, Tomohiro
On 2017/12/04 16:19, Anand Jain wrote: > When device is missing its not necessary that btrfs_device::name is null > or the path is different when it reappears. Its possible that device can > go missing after its been scanned where neither of > btrfs_device::name == NULL OR btrfs_device::name !=

[RFC] Improve subvolume usability for a normal user

2017-12-05 Thread Misono, Tomohiro
Hello all, I want to address some issues of subvolume usability for a normal user. i.e. a user can create subvolumes, but - Cannot delete their own subvolume (by default) - Cannot tell subvolumes from directories (in a straightforward way) - Cannot check the quota limit when qgroup is enabled

Re: [PATCH 2/2] btrfs-progs: doc: remove explanation of 'X' attribute

2017-12-12 Thread Misono, Tomohiro
1st patch requires btrfs/048's output to be modified. If the patch is Ok, I will update the xfstest. Thanks, Tomohiro On 2017/12/13 3:37, David Sterba wrote: > On Tue, Dec 12, 2017 at 04:08:17PM +0900, Misono, Tomohiro wrote: >> e2fsprogs has removed compression support si

Re: [PATCH] btrfs: Fix memory leak on multiple mounts

2017-12-18 Thread Misono, Tomohiro
Hello, On 2017/12/18 19:06, Nikolay Borisov wrote: > > > On 18.12.2017 12:03, Nikolay Borisov wrote: >> Currently if a mounted-btrfs instance is mounted for the 2nd time >> without first unmounting the first instance then we hit a memory leak >> in btrfs_mount_root due to the fs_info of the

[PATCH v4 1/4] btrfs: add btrfs_mount_root() and new file_system_type

2017-12-14 Thread Misono, Tomohiro
Add btrfs_mount_root() and new file_system_type for preparation of cleanup of btrfs_mount(). Code path is not changed yet. btrfs_mount_root() is almost the same as current btrfs_mount(), but doesn't have subvolume related part. Signed-off-by: Tomohiro Misono ---

[PATCH v4 2/4] btrfs: cleanup btrfs_mount() using btrfs_mount_root()

2017-12-14 Thread Misono, Tomohiro
Cleanup btrfs_mount() by using btrfs_mount_root(). This avoids getting btrfs_mount() called twice in mount path. Old btrfs_mount() will do: 0. VFS layer calls vfs_kern_mount() with registered file_system_type (for btrfs, btrfs_fs_type). btrfs_mount() is called on the way. 1.

[PATCH v4 3/4] btrfs: split parse_early_options() in two

2017-12-14 Thread Misono, Tomohiro
Now parse_early_options() is used by both btrfs_mount() and btrfs_mount_root(). However, the former only needs subvol related part and the latter needs the others. Therefore extract the subvol related parts from parse_early_options() and move it to new parse function (parse_subvol_options()).

[PATCH] btrfs: cleanup unnecessary string dup in btrfs_parse_options()

2017-12-14 Thread Misono, Tomohiro
Long ago, commit edf24abe51493 ("btrfs: sanity mount option parsing and early mount code") split the btrfs_parse_options() into two parts (btrfs_parse_early_options() and btrfs_parse_options()). As a result, btrfs_parse_optins no longer gets called twice and is the last one to parse mount option

[PATCH v4 0/4] btrfs: cleanup mount path

2017-12-14 Thread Misono, Tomohiro
Summary: Cleanup mount path by avoiding calling btrfs_mount() twice. No functional changes. See below for longer explanation. Changelog: v4: - Rebased to v4.15-rc3 - Change MS_* flags to SB_* flags - Change GFP_NOFS to GFP_KERNEL - Use if statements instead of switch in

[PATCH v4 4/4] btrfs: remove unused setup_root_args()

2017-12-14 Thread Misono, Tomohiro
Since setup_root_args() is not used anymore, just remove it. Signed-off-by: Tomohiro Misono --- fs/btrfs/super.c | 36 1 file changed, 36 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index

Re: [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type

2017-12-19 Thread Misono, Tomohiro
On 2017/12/19 19:53, Qu Wenruo wrote: > Since kernel is deprecating the support for specifying inherit type, > remove the support in btrfs-progs too. > > Thankfully, the options for qgroup inheritance is hidden and not > documented, so user shouldn't be affected at all. > > Signed-off-by: Qu

[PATCH] fstests: btrfs: add 'zstd' to compress property filter

2017-11-07 Thread Misono, Tomohiro
This fixes the false failure of btrfs/059 when running with the mount option '-o compress=zstd'. Signed-off-by: Tomohiro Misono --- common/filter.btrfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/filter.btrfs b/common/filter.btrfs

Re: [RFC] Improve subvolume usability for a normal user

2017-12-06 Thread Misono, Tomohiro
On 2017/12/07 11:56, Duncan wrote: > Austin S. Hemmelgarn posted on Wed, 06 Dec 2017 07:39:56 -0500 as > excerpted: > >> Somewhat OT, but the only operation that's remotely 'instant' is >> creating an empty subvolume. Snapshot creation has to walk the tree in >> the subvolume being snapshotted,

Re: [RFC] Improve subvolume usability for a normal user

2017-12-05 Thread Misono, Tomohiro
On 2017/12/05 21:41, Austin S. Hemmelgarn wrote: > On 2017-12-05 03:43, Qu Wenruo wrote: >> >> >> On 2017年12月05日 16:25, Misono, Tomohiro wrote: >>> Hello all, >>> >>> I want to address some issues of subvolume usability for a normal user. >>&

Re: [RFC v2] Improve subvolume usability for a normal user

2017-12-11 Thread Misono, Tomohiro
Hello, On 2017/12/11 16:30, ein wrote: > On 12/11/2017 07:38 AM, Misono, Tomohiro wrote: >> - Change the default behavior to allow a user to delete subvolume which is >> empty > > From sysadmin point of view I think it's worth considering the following > scenario(s): &

[RFC v2] Improve subvolume usability for a normal user

2017-12-10 Thread Misono, Tomohiro
Hello all, I reflected the comments of the first version of the RFC[1]. Thanks for all those who commented. The summary of updated proposal is: - Change the default behavior to allow a user to delete subvolume which is empty - Add 2 new non-root ioctls to get subvolume/quota info under the

[PATCH 2/2] btrfs-progs: doc: remove explanation of 'X' attribute

2017-12-11 Thread Misono, Tomohiro
e2fsprogs has removed compression support since v1.43 and there is no field 'X' (no compress) for lxattr now. So, just remove the explanation. Instead, "property get" can be used to check whether no compress flag is set. Signed-off-by: Tomohiro Misono ---

  1   2   3   4   >