[PATCH] btrfs-progs: misc-test/034: Avoid debug log populating stdout

2019-07-23 Thread Qu Wenruo
When running misc-test/034, we got unexpected log output: [TEST/misc] 033-filename-length-limit [TEST/misc] 034-metadata-uuid Checking btrfstune logic Checking dump-super output Checking output after fsid change Checking for incompat textual representation Checking setting

Re: [PATCH 2/2 RESEND Rebased] btrfs-progs: add readmirror policy

2019-07-23 Thread Anand Jain
On 23/7/19 9:53 PM, David Sterba wrote: On Wed, Jun 26, 2019 at 04:37:23PM +0800, Anand Jain wrote: This sets the readmirror= as a btrfs. extentded attribute. Signed-off-by: Anand Jain --- props.c | 49 + 1 file changed, 49 insertions(+) diff

Re: [PATCH 0/3 RESEND Rebased] readmirror feature

2019-07-23 Thread Qu Wenruo
On 2019/7/24 上午10:26, Anand Jain wrote: > > >> On 24 Jul 2019, at 8:20 AM, Qu Wenruo wrote: >> >> >> >> On 2019/6/26 下午4:33, Anand Jain wrote: >>> These patches are tested to be working fine. >>> >>> Function call chain __btrfs_map_block()->find_live_mirror() uses >>> thread pid to determine

Re: [PATCH] fs: btrfs: Fix a possible null-pointer dereference in insert_inline_extent()

2019-07-23 Thread Qu Wenruo
On 2019/7/24 上午10:33, Jia-Ju Bai wrote: > > > On 2019/7/24 10:21, Qu Wenruo wrote: >> >> On 2019/7/24 上午10:11, Jia-Ju Bai wrote: >>> In insert_inline_extent(), there is an if statement on line 181 to check >>> whether compressed_pages is NULL: >>> if (compressed_size && compressed_pages) >

Re: [PATCH 2/3 RESEND Rebased] btrfs: add readmirror property framework

2019-07-23 Thread Anand Jain
> On 23 Jul 2019, at 10:57 PM, David Sterba wrote: > > On Wed, Jun 26, 2019 at 04:34:01PM +0800, Anand Jain wrote: >> Function call chain __btrfs_map_block()->find_live_mirror() uses >> thread %pid to determine the %mirror_num for the read when mirror_num=0 >> in the argument. >> >> This pat

Reminder: 3 open syzbot bugs in "fs/btrfs" subsystem

2019-07-23 Thread Eric Biggers
[This email was generated by a script. Let me know if you have any suggestions to make it better, or if you want it re-generated with the latest status.] Of the currently open syzbot reports against the upstream kernel, I've manually marked 3 of them as possibly being bugs in the "fs/btrfs" subsy

Re: [PATCH] fs: btrfs: Fix a possible null-pointer dereference in insert_inline_extent()

2019-07-23 Thread Jia-Ju Bai
On 2019/7/24 10:21, Qu Wenruo wrote: On 2019/7/24 上午10:11, Jia-Ju Bai wrote: In insert_inline_extent(), there is an if statement on line 181 to check whether compressed_pages is NULL: if (compressed_size && compressed_pages) When compressed_pages is NULL, compressed_pages is used on li

Re: [PATCH 0/3 RESEND Rebased] readmirror feature

2019-07-23 Thread Anand Jain
> On 24 Jul 2019, at 8:20 AM, Qu Wenruo wrote: > > > > On 2019/6/26 下午4:33, Anand Jain wrote: >> These patches are tested to be working fine. >> >> Function call chain __btrfs_map_block()->find_live_mirror() uses >> thread pid to determine the %mirror_num when the mirror_num=0. >> >> This

Re: [PATCH] fs: btrfs: Fix a possible null-pointer dereference in insert_inline_extent()

2019-07-23 Thread Qu Wenruo
On 2019/7/24 上午10:11, Jia-Ju Bai wrote: > In insert_inline_extent(), there is an if statement on line 181 to check > whether compressed_pages is NULL: > if (compressed_size && compressed_pages) > > When compressed_pages is NULL, compressed_pages is used on line 215: > cpage = compressed_

[PATCH] fs: btrfs: Fix a possible null-pointer dereference in insert_inline_extent()

2019-07-23 Thread Jia-Ju Bai
In insert_inline_extent(), there is an if statement on line 181 to check whether compressed_pages is NULL: if (compressed_size && compressed_pages) When compressed_pages is NULL, compressed_pages is used on line 215: cpage = compressed_pages[i]; Thus, a possible null-pointer dereference m

Re: [PATCH 0/3 RESEND Rebased] readmirror feature

2019-07-23 Thread Qu Wenruo
On 2019/6/26 下午4:33, Anand Jain wrote: > These patches are tested to be working fine. > > Function call chain __btrfs_map_block()->find_live_mirror() uses > thread pid to determine the %mirror_num when the mirror_num=0. > > This patch introduces a framework so that we can add policies to deter

Re: [PATCH v3 3/4] Btrfs: Switch to use new generic UUID API

2019-07-23 Thread Andy Shevchenko
On Thu, Jul 18, 2019 at 07:44:00PM +0200, Johannes Thumshirn wrote: > On Thu, Jul 18, 2019 at 08:38:42PM +0300, Andy Shevchenko wrote: > > On Thu, Jul 18, 2019 at 07:20:17PM +0200, Johannes Thumshirn wrote: > > > On Wed, Jul 17, 2019 at 02:36:32PM +0300, Andy Shevchenko wrote: > > > > There are new

Re: [PATCH 3/3 RESEND Rebased] btrfs: add readmirror devid property

2019-07-23 Thread David Sterba
On Tue, Jul 23, 2019 at 04:55:53PM +0200, David Sterba wrote: > On Wed, Jun 26, 2019 at 04:34:02PM +0800, Anand Jain wrote: > > Introduces devid readmirror property, to direct read IO to the specified > > device(s). > > > > The readmirror property is stored as extended attribute on the root > > in

Re: [PATCH 2/3 RESEND Rebased] btrfs: add readmirror property framework

2019-07-23 Thread David Sterba
On Wed, Jun 26, 2019 at 04:34:01PM +0800, Anand Jain wrote: > Function call chain __btrfs_map_block()->find_live_mirror() uses > thread %pid to determine the %mirror_num for the read when mirror_num=0 > in the argument. > > This patch introduces a framework so that readmirror is a configurable >

Re: [PATCH 3/3 RESEND Rebased] btrfs: add readmirror devid property

2019-07-23 Thread David Sterba
On Wed, Jun 26, 2019 at 04:34:02PM +0800, Anand Jain wrote: > Introduces devid readmirror property, to direct read IO to the specified > device(s). > > The readmirror property is stored as extended attribute on the root > inode. So this is permanently stored on the filesystem, is the policy appli

Re: [PATCH 2/2 RESEND Rebased] btrfs-progs: add readmirror policy

2019-07-23 Thread David Sterba
On Wed, Jun 26, 2019 at 04:37:23PM +0800, Anand Jain wrote: >prop_object_inode, prop_compression}, > + {"readmirror", "set/get readmirror policy for filesystem", 0, The help text for the property is useless.

Re: [PATCH 2/2 RESEND Rebased] btrfs-progs: add readmirror policy

2019-07-23 Thread David Sterba
On Wed, Jun 26, 2019 at 04:37:23PM +0800, Anand Jain wrote: > This sets the readmirror= as a btrfs. extentded attribute. > > Signed-off-by: Anand Jain > --- > props.c | 49 + > 1 file changed, 49 insertions(+) > > diff --git a/props.c b/props.c >

Re: [PATCH v2 4/4] btrfs-progs: tests: add test for receiving clone from duplicate subvolume

2019-07-23 Thread Filipe Manana
On Tue, Jul 23, 2019 at 3:25 AM Omar Sandoval wrote: > > From: Omar Sandoval > > This test case is the reproducer for the previous fix. > > Signed-off-by: Omar Sandoval Reviewed-by: Filipe Manana Looks good, thanks! > --- > .../test.sh | 34

Re: [PATCH v2 3/4] btrfs-progs: receive: don't lookup clone root for received subvolume

2019-07-23 Thread Filipe Manana
On Tue, Jul 23, 2019 at 3:25 AM Omar Sandoval wrote: > > From: Omar Sandoval > > When we process a clone request, we look up the source subvolume by > UUID, even if the source is the subvolume that we're currently > receiving. Usually, this is fine. However, if for some reason we > previously rec

Re: [PATCH] btrfs-progs: check: initialize qgroup_item_count in earlier stage

2019-07-23 Thread Qu Wenruo
On 2019/7/23 下午5:19, Naohiro Aota wrote: > "btrfsck -Q" segfaults because it does not call qgroup_set_item_count_ptr() > properly: > > # btrfsck -Q /dev/sdk > Opening filesystem to check... > Checking filesystem on /dev/sdk > UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3 > Print quota gro

[PATCH] btrfs-progs: check: initialize qgroup_item_count in earlier stage

2019-07-23 Thread Naohiro Aota
"btrfsck -Q" segfaults because it does not call qgroup_set_item_count_ptr() properly: # btrfsck -Q /dev/sdk Opening filesystem to check... Checking filesystem on /dev/sdk UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3 Print quota groups for /dev/sdk UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6

[PATCH] btrfs: extent-tree: Add comment for walk_control to explain how btrfs drops a subvolume.

2019-07-23 Thread Qu Wenruo
Btrfs uses several different ways to drop a subvolume. Some methods are designed to reduce the modification to extent tree. This design can be very confusing if not familiar with btrfs_drop_snapshot(). Before wasting time of newcomers, just add some explanation. Also add some basic comment for me