Re: raid1: can't readd removed dev while the fs is mounted

2017-10-27 Thread Timofey Titovets
2017-10-28 1:40 GMT+03:00 Julien Muchembled : > Hello, > > I have 2 disks in RAID1, each one having 2 partitions: > - 1 for / (BtrFS) > - 1 for /home (MD/XFS) > > For some reasons, 1 disk was removed and readded. I had no issue at readding > it to the MD array, but for BtrFS, I

Re: Data and metadata extent allocators [1/2]: Recap: The data story

2017-10-27 Thread Qu Wenruo
On 2017年10月28日 02:17, Hans van Kranenburg wrote: > Hi, > > This is a followup to my previous threads named "About free space > fragmentation, metadata write amplification and (no)ssd" [0] and > "Experiences with metadata balance/convert" [1], exploring how good or > bad btrfs can handle

Re: [PATCH v3 2/2] btrfs-progs: test/mkfs: Test if the minimal device size is valid

2017-10-27 Thread Qu Wenruo
On 2017年10月28日 00:59, David Sterba wrote: > On Fri, Oct 27, 2017 at 08:53:24AM +0800, Qu Wenruo wrote: >> New test case to test if the minimal device size given by "mkfs.btrfs" >> failure case is valid. >> >> Signed-off-by: Qu Wenruo >> --- >>

Re: [PATCH 0/8] mkfs: Quota support

2017-10-27 Thread Qu Wenruo
On 2017年10月28日 01:37, David Sterba wrote: > On Fri, Oct 27, 2017 at 03:29:28PM +0800, Qu Wenruo wrote: >> This patchset adds quota support, which means the result fs will have >> quota enabled by default, and its accounting is already consistent, no >> manually rescan or quota enable is needed.

raid1: can't readd removed dev while the fs is mounted

2017-10-27 Thread Julien Muchembled
Hello, I have 2 disks in RAID1, each one having 2 partitions: - 1 for / (BtrFS) - 1 for /home (MD/XFS) For some reasons, 1 disk was removed and readded. I had no issue at readding it to the MD array, but for BtrFS, I had to reboot. Then, I tried to investigate more using qemu with

Re: Data and metadata extent allocators [1/2]: Recap: The data story

2017-10-27 Thread Hans van Kranenburg
Hi Martin, On 10/27/2017 10:10 PM, Martin Steigerwald wrote: >> Q: How do I fight this and prevent getting into a situation where all >> raw space is allocated, risking a filesystem crash? >> A: Use btrfs balance to fight the symptoms. It reads data and writes it >> out again without the free

Data and metadata extent allocators [2/2]: metadata!

2017-10-27 Thread Hans van Kranenburg
Ok, it's time to start looking at the other half of the story... The behavior of the metadata extent allocator. Interesting questions here are: Q: If I point btrfs balance at 1GiB of data, why does it need to write 40GiB to disk while only relocating this 1GiB amount? What's the other 39GiB

Re: Data and metadata extent allocators [1/2]: Recap: The data story

2017-10-27 Thread Martin Steigerwald
Hello Hans, Hans van Kranenburg - 27.10.17, 20:17: > This is a followup to my previous threads named "About free space > fragmentation, metadata write amplification and (no)ssd" [0] and > "Experiences with metadata balance/convert" [1], exploring how good or > bad btrfs can handle filesystems

Data and metadata extent allocators [1/2]: Recap: The data story

2017-10-27 Thread Hans van Kranenburg
Hi, This is a followup to my previous threads named "About free space fragmentation, metadata write amplification and (no)ssd" [0] and "Experiences with metadata balance/convert" [1], exploring how good or bad btrfs can handle filesystems that are larger than your average desktop computer and/or

Re: [PATCH 0/8] mkfs: Quota support

2017-10-27 Thread David Sterba
On Fri, Oct 27, 2017 at 03:29:28PM +0800, Qu Wenruo wrote: > This patchset adds quota support, which means the result fs will have > quota enabled by default, and its accounting is already consistent, no > manually rescan or quota enable is needed. Great, thanks for working on that. I'm going to

Re: [PATCH v3 2/2] btrfs-progs: test/mkfs: Test if the minimal device size is valid

2017-10-27 Thread David Sterba
On Fri, Oct 27, 2017 at 08:53:24AM +0800, Qu Wenruo wrote: > New test case to test if the minimal device size given by "mkfs.btrfs" > failure case is valid. > > Signed-off-by: Qu Wenruo > --- > tests/mkfs-tests/010-small-image/test.sh | 49 > > 1

Re: [PATCH v3 1/2] btrfs-progs: test/common: Introduce run_mustfail_stdout and enhance prepare_test_dev

2017-10-27 Thread David Sterba
On Fri, Oct 27, 2017 at 08:53:23AM +0800, Qu Wenruo wrote: > Introduce a new function, run_mustfail_stdout(), which is similar to > run_mustfail(), with extra output redirection. > Also this new run_mustfail_stdout() doesn't set pipefail and use > temporary file to catch the output. > So it

Re: [PATCH v2 0/6] Btrfs-progs: rescue: To fix device related

2017-10-27 Thread David Sterba
On Tue, Oct 17, 2017 at 05:13:06PM +0800, Qu Wenruo wrote: > The patchset can be fetched from github: > https://github.com/adam900710/btrfs-progs/tree/check_unaligned_dev > > There are several reports in mail list for btrfs device size related > problems. > > 1) kernel refuse to mount some fs,

Re: [PATCH 1/1] btrfs-progs: tests/common: Display warning only after searching for btrfs kernel module

2017-10-27 Thread David Sterba
On Fri, Oct 27, 2017 at 11:30:24AM +0530, Lakshmipathi.G wrote: > Signed-off-by: Lakshmipathi.G Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH v2] btrfs-progs: reserve < 0 return value for errnos

2017-10-27 Thread Anand Jain
btrfs_read_dev_super() returns -1 / -EPERM upon not finding a suitable SB, change that to return -ENOENT instead, which is much closer to the actual possible errors. Signed-off-by: Anand Jain --- v2: use -ENOENT instead of 1. disk-io.c | 2 +- utils.c | 2 +- volumes.c

Re: [PATCH] btrfs-progs: reserve < 0 return value for errnos

2017-10-27 Thread Anand Jain
On 10/27/2017 04:04 PM, Qu Wenruo wrote: On 2017年10月27日 15:54, Nikolay Borisov wrote: On 27.10.2017 10:31, Anand Jain wrote: btrfs_read_dev_super() returns -1 upon not finding a suitable SB, change that to return 1 instead, so that it can reserve the < 0 values for the errno

[PATCH v2] Btrfs: add support for fallocate's zero range operation

2017-10-27 Thread fdmanana
From: Filipe Manana This implements support the zero range operation of fallocate. For now at least it's as simple as possible while reusing most of the existing fallocate and hole punching infrastructure. Signed-off-by: Filipe Manana --- V2: Removed

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

2017-10-27 Thread David Sterba
On Fri, Oct 20, 2017 at 10:41:42AM +0900, Misono, Tomohiro wrote: > 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 >

[PATCH] Btrfs: add support for fallocate's zero range operation

2017-10-27 Thread fdmanana
From: Filipe Manana This implements support the zero range operation of fallocate. For now at least it's as simple as possible while reusing most of the existing fallocate and hole punching infrastructure. Signed-off-by: Filipe Manana --- fs/btrfs/file.c

Re: [PATCH] btrfs-progs: reserve < 0 return value for errnos

2017-10-27 Thread Qu Wenruo
On 2017年10月27日 15:54, Nikolay Borisov wrote: > > > On 27.10.2017 10:31, Anand Jain wrote: >> btrfs_read_dev_super() returns -1 upon not finding a suitable SB, >> change that to return 1 instead, so that it can reserve the < 0 >> values for the errno communications. >> >> Signed-off-by: Anand

Re: [PATCH] btrfs-progs: reserve < 0 return value for errnos

2017-10-27 Thread Nikolay Borisov
On 27.10.2017 10:31, Anand Jain wrote: > btrfs_read_dev_super() returns -1 upon not finding a suitable SB, > change that to return 1 instead, so that it can reserve the < 0 > values for the errno communications. > > Signed-off-by: Anand Jain I believe this is buggy

[PATCH] btrfs-progs: reserve < 0 return value for errnos

2017-10-27 Thread Anand Jain
btrfs_read_dev_super() returns -1 upon not finding a suitable SB, change that to return 1 instead, so that it can reserve the < 0 values for the errno communications. Signed-off-by: Anand Jain --- An independent patch, not related to any recent patch sent to ML.

[PATCH 4/8] btrfs-progs: qgroup-verify: Allow repair_qgroups function to do silent repair

2017-10-27 Thread Qu Wenruo
Allow repair_qgroups() to do silent repair, so it can acts as offline qgroup rescan. This provides the basis for later mkfs quota support. Signed-off-by: Qu Wenruo --- cmds-check.c| 2 +- qgroup-verify.c | 19 +++ qgroup-verify.h | 2 +- 3 files changed, 13

[PATCH 8/8] btrfs-progs: test/mkfs: Add test case for --enable-quota option

2017-10-27 Thread Qu Wenruo
Only test if btrfs check (which will check qgroup by default) and kernel mount success. Comprehensive qgroup test cases still belongs to fstests. Signed-off-by: Qu Wenruo --- tests/mkfs-tests/001-basic-profiles/test.sh | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH 7/8] btrfs-progs: mkfs: Introduce option to enable quota at mkfs time

2017-10-27 Thread Qu Wenruo
Introduce new parameter, --enable-quota, to enable quota at mkfs time. The result fs will has quota enabled, with consistent qgroup accounting. This is quite handy to test quota with fstests, which doesn't support to call ioctl for btrfs at mount time. Signed-off-by: Qu Wenruo

[PATCH 5/8] btrfs-progs: ctree: Introduce function to create an empty tree

2017-10-27 Thread Qu Wenruo
Introduce a new function, btrfs_create_tree(), to create an empty tree. Currently, there is only one caller to create new tree, namely data reloc tree in mkfs. However it's copying fs tree to create a new root. This copy fs tree method is not a good idea if we only need an empty tree. So here

[PATCH 3/8] btrfs-progs: qgroup-verify: Move qgroup classification out of report_qgroups

2017-10-27 Thread Qu Wenruo
The original qgroup-verify integrates qgroup classification into report_qgroups(). This behavior makes silent qgroup repair (or offline rescan) impossible. To repair qgroup, we must call report_qgroups() to trigger bad qgroup classification, which will output error message. This patch moves bad

[PATCH 6/8] btrfs-progs: mkfs: Introduce function to insert qgroup info and limit items

2017-10-27 Thread Qu Wenruo
Introduce a new function, insert_qgroup_items(), to insert qgroup info item and qgroup limit item for later mkfs qgroup support. Signed-off-by: Qu Wenruo --- mkfs/main.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/mkfs/main.c

[PATCH 1/8] btrfs-progs: qgroup-verify: Also repair qgroup status version

2017-10-27 Thread Qu Wenruo
Current kernel only supports qgroup version 1. Make qgroup-verify to follow this standard. Signed-off-by: Qu Wenruo --- ctree.h | 1 + qgroup-verify.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ctree.h b/ctree.h index 22806599a744..506b76766579 100644 ---

[PATCH 0/8] mkfs: Quota support

2017-10-27 Thread Qu Wenruo
This patchset adds quota support, which means the result fs will have quota enabled by default, and its accounting is already consistent, no manually rescan or quota enable is needed. The overall design of such support is: 1) Create needed tree Both btrfs_root and real root item and tree root

[PATCH 2/8] btrfs-progs: qgroup-verify: Use fs_info->readonly to check if we should repair qgroups

2017-10-27 Thread Qu Wenruo
In fact qgroup-verify is just kind of offline qgroup rescan, and later mkfs qgroup support will reuse it. So qgroup-verify doesn't really need to rely the global variable @repair to check if it should repair qgroups. Instead check fs_info->readonly to do the repair. Signed-off-by: Qu Wenruo

[PATCH] btrfs-progs: when unable to find out fsid of a dev just skip

2017-10-27 Thread Anand Jain
%fi_args.num_devices provides number of devices excluding the seed device. So when looping through the device list for a given fsid, determine if the given device is a seed device by reading its superblock and then skip it if its a seed device. Reading of the superblock is done by the function

[PATCH 1/1] btrfs-progs: tests/common: Display warning only after searching for btrfs kernel module

2017-10-27 Thread Lakshmipathi.G
Signed-off-by: Lakshmipathi.G --- tests/common | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/common b/tests/common index eb525a4..773b1e5 100644 --- a/tests/common +++ b/tests/common @@ -428,8 +428,12 @@ run_check_umount_test_dev()