Re: [PATCH 10/16] btrfs: remove wrong use of volume_mutex from btrfs_dev_replace_start

2018-04-09 Thread Nikolay Borisov
On 9.04.2018 11:39, Anand Jain wrote: > > > On 04/04/2018 02:34 AM, David Sterba wrote: >> The volume mutex does not protect against anything in this case, the >> comment about scrub is right but not related to locking and looks >> confusing. The comment in

Re: [PATCH] btrfs-progs: dump-super: Refactor print function and add extra check

2018-04-09 Thread Nikolay Borisov
On 9.04.2018 10:47, Qu Wenruo wrote: > When manually patching super blocks, current validation check is pretty > weak (limited to magic number and csum) and doesn't provide extra check > for some obvious corruption (like invalid sectorsize). > > This patch will enhance dump-super by: > > 1)

Re: Unable to compile btrfs progs 4.16 on ubuntu Xenial

2018-04-08 Thread Nikolay Borisov
On 7.04.2018 20:16, Menion wrote: > Hi all > Apparently it is not possible to compile with python bindings the > btrfs progs on ubuntu xenial > > checking for a Python interpreter with version >= 3.4... python3 > checking for python3... /usr/bin/python3 > checking for python3 version... 3.5 >

Re: Unable to compile btrfs progs 4.16 on ubuntu Xenial

2018-04-08 Thread Nikolay Borisov
On 8.04.2018 11:11, Menion wrote: > ./configure --prefix=/usr --disable-documentation --enable-zstd I was able to reproduce with --prefix added, thanks. > > 2018-04-08 9:17 GMT+02:00 Nikolay Borisov <nbori...@suse.com>: >> >> >> On 7.04.2018 23:40, Menion

Re: Unable to compile btrfs progs 4.16 on ubuntu Xenial

2018-04-08 Thread Nikolay Borisov
On 7.04.2018 23:40, Menion wrote: > I am adding - - prefix=/usr that seems you are not using > Clearly you haven't shared all the necessary information, post your entire configure line > 2018-04-07 21:55 GMT+02:00 Nikolay Borisov <nbori...@suse.com>: >> >> >

Re: Unable to compile btrfs progs 4.16 on ubuntu Xenial

2018-04-07 Thread Nikolay Borisov
On 7.04.2018 20:16, Menion wrote: > Hi all > Apparently it is not possible to compile with python bindings the > btrfs progs on ubuntu xenial > > checking for a Python interpreter with version >= 3.4... python3 > checking for python3... /usr/bin/python3 > checking for python3 version... 3.5 >

Re: Bad magic on superblock on /dev/sda at 65536

2018-04-06 Thread Nikolay Borisov
On 6.04.2018 16:32, Ben Parsons wrote: > Hi, > > I just had an unexpected restart and now my btrfs pool wont mount. > The error on mount is: > > "ERROR: unsupported checksum algorithm 41700" > > and when running > > btrfs inspect-internal dump-super /dev/sda > ERROR: bad magic

Re: [PATCH v2] Btrfs: fix NULL pointer dereference in log_dir_items

2018-04-05 Thread Nikolay Borisov
nd we may run into a null pointer dereference panic. >> >> Fixes: e02119d5a7b4 ("Btrfs: Add a write ahead tree log to optimize >> synchronous operations") >> Reviewed-by: Nikolay Borisov <nbori...@suse.com> >> Signed-off-by: Liu Bo <bo@linux.al

Re: [PATCH] btrfs: Fix possible softlock on single core machines

2018-04-05 Thread Nikolay Borisov
On 5.04.2018 16:55, David Sterba wrote: > On Thu, Apr 05, 2018 at 10:40:15AM +0300, Nikolay Borisov wrote: >> do_chunk_alloc implements a loop checking whether there is a pending >> chunk allocation and if so causes the caller do loop. Generally this >> loop is execut

[PATCH] btrfs: Drop delayed_refs argument from btrfs_check_delayed_seq

2018-04-04 Thread Nikolay Borisov
It's used to print its pointer in a debug statement but doesn't really bring any useful information to the error message. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 9 +++-- fs/btrfs/delayed-ref.h | 4 +--- fs/btrfs/extent-tree.c | 2 +- 3 files c

Re: [PATCH 1/2] btrfs-progs: check: Skip data csum verification for metadata dump

2018-04-03 Thread Nikolay Borisov
On 3.04.2018 08:55, Qu Wenruo wrote: > > > On 2018年04月03日 13:51, Nikolay Borisov wrote: >> >> >> On 3.04.2018 08:39, Qu Wenruo wrote: >>> For metadata dump (fs restored by btrfs-image), since no data is >>> restored check sum verification will de

Re: [PATCH 1/2] btrfs-progs: check: Skip data csum verification for metadata dump

2018-04-02 Thread Nikolay Borisov
w...@suse.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > check/main.c | 13 - > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/check/main.c b/check/main.c > index 891a6d797756..15c94543946a 100644 > --- a/check/main.c &

Re: [PATCH] Btrfs: fix NULL pointer dereference in log_dir_items

2018-04-02 Thread Nikolay Borisov
On 2.04.2018 20:51, Liu Bo wrote: > On Sun, Apr 1, 2018 at 3:03 AM, Nikolay Borisov <nbori...@suse.com> wrote: >> >> >> On 31.03.2018 01:11, Liu Bo wrote: >>> 0, 1 and <0 can be returned by btrfs_next_leaf(), and when <0 is >>> returned

Re: [PATCH] btrfs: rename btrfs_get_block_group_info and make it static

2018-04-02 Thread Nikolay Borisov
tl.c now. > Its parameter type btrfs_ioctl_space_info* is only for ioctl. > > So, make it static and rename it to be original name > get_block_group_info. > > No functional change. > > Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com> Reviewed-by: Nikolay Borisov <

Re: [PATCH] Btrfs: bail out on error during replay_dir_deletes

2018-04-01 Thread Nikolay Borisov
On 31.03.2018 01:11, Liu Bo wrote: > If errors were returned by btrfs_next_leaf(), replay_dir_deletes needs > to bail out, otherwise @ret would be forced to be 0 after 'break;' and > the caller won't be aware of it. > > Signed-off-by: Liu Bo <bo@linux.alibaba.com>

Re: [PATCH] Btrfs: fix NULL pointer dereference in log_dir_items

2018-04-01 Thread Nikolay Borisov
o <bo@linux.alibaba.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> This bug has been present ever since 2.6.29 (e02119d5a7b4 ("Btrfs: Add a write ahead tree log to optimize synchronous operations")) so this needs a stable tag. > --- > fs/btrfs/tree-log.c | 7

[PATCH] btrfs: Replace owner argument in add_pinned_bytes with a boolean

2018-03-30 Thread Nikolay Borisov
know the type of extents we are working with (i.e. in btrfs_free_tree_block). In cases when the parent function can be called on both metadata/data extents perform the check in the caller. This hopefully makes the interface of add_pinned_bytes more intuitive. Signed-off-by: Nikolay Borisov <nb

Re: [PATCH] btrfs-progs: Remove unused parameter

2018-03-29 Thread Nikolay Borisov
On 30.03.2018 05:56, Gu Jinxiang wrote: > Parameter usagestr is not used, remove it. > > Signed-off-by: Gu Jinxiang <g...@cn.fujitsu.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > cmds-filesystem.c | 2 +- > help.c| 2 +- > hel

Re: [PATCH v3 5/7] btrfs: verify superblock checksum during scan

2018-03-29 Thread Nikolay Borisov
rrr. > Un-split pr_err() string. > Fix typo in the git commit log. > Move the csum check after bytenr and btrfs magic verified. > > btrfs: make btrfs_check_super_csum() non-static > > In preparation to add the superblock csum verification for the > scan context, ma

Re: [PATCH v2 4/7] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-29 Thread Nikolay Borisov
overwriting superblock during mkfs. > > Signed-off-by: Anand Jain <anand.j...@oracle.com> > v1->v2: > Do an explicit read for primary superblock. Drop kzalloc(). > Fix split pr_err(). Same thing about the change log as in 2/7. Otherwise : Reviewe

Re: [PATCH v2 2/7] btrfs: return required error from btrfs_check_super_csum

2018-03-29 Thread Nikolay Borisov
dent reported by checkpatch.pl > Fix pr_err split string The change log has to go below the scissors line. I guess it can be fixed at merge time so I don't think a resubmit is warranted. There is one nit below but I don't think it's critical so : Reviewed-by: Nikolay Borisov <nbori...@suse.co

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

2018-03-29 Thread Nikolay Borisov
On 29.03.2018 11:22, Misono Tomohiro wrote: > "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. > >

Re: [PATCH v2 6/8] btrfs: verify superblock checksum during scan

2018-03-28 Thread Nikolay Borisov
On 28.03.2018 02:39, Anand Jain wrote: > During the scan context, we aren't verifying the superblock- > checksum when read. > This patch fixes it by adding the checksum verification function > btrfs_check_super_csum() in the function btrfs_read_disk_super(). > And makes device scan to error fail

Re: [PATCH v2 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-28 Thread Nikolay Borisov
On 28.03.2018 02:39, Anand Jain wrote: > During the btrfs dev scan make sure that other copies of superblock > contain the same fsid as the primary SB. So that we bring to the > user notice if the superblock has been overwritten. > > mkfs.btrfs -fq /dev/sdc > mkfs.btrfs -fq /dev/sdb > dd

Re: [PATCH v2 3/8] btrfs: cleanup btrfs_read_disk_super() to return std error

2018-03-28 Thread Nikolay Borisov
ed-off-by: Anand Jain <anand.j...@oracle.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > v1->v2: > Check btrfs_read_disk_super() to be more explicit ret < 0 > > fs/btrfs/volumes.c | 15 +++ > 1 file changed, 7 insertions(+), 8 del

Re: [PATCH 6/8] btrfs: verify checksum when superblock is read for scan

2018-03-28 Thread Nikolay Borisov
On 28.03.2018 02:01, Anand Jain wrote: > > Test script:   Corrupt primary superblock and check if device scan and mount   fails:   mkfs.btrfs -fq /dev/sdc   dd if=/dev/urandom of=/dev/sdc ibs=1 obs=1 count=1 seek=64K   btrfs dev scan   mount /dev/sdb

Re: [PATCH 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-28 Thread Nikolay Borisov
On 28.03.2018 01:06, Anand Jain wrote: > > > On 03/27/2018 04:49 PM, Nikolay Borisov wrote: >> >> >> On 26.03.2018 11:27, Anand Jain wrote: >>> During the btrfs dev scan make sure that other copies of superblock >>> contain the same fsid as the

Re: [PATCH v2 2/3] btrfs: Allow rmdir(2) to delete a subvolume

2018-03-27 Thread Nikolay Borisov
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 progress. > > New function btrfs_delete_subvolume() is almost equal to the second half > of

Re: [PATCH 7/8] btrfs: verify checksum for all devices in mount context

2018-03-27 Thread Nikolay Borisov
orth it documenting them in the changelog. > > Signed-off-by: Anand Jain <anand.j...@oracle.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > fs/btrfs/disk-io.c | 35 +-- > 1 file changed, 17 insertions(+), 18 deletions(-) >

Re: [PATCH 4/8] btrfs: make btrfs_check_super_csum() non-static

2018-03-27 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > In preparation to add the superblock csum verification for the > scan context, make btrfs_check_super_csum() non-static. > > Signed-off-by: Anand Jain <anand.j...@oracle.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> >

Re: [PATCH 6/8] btrfs: verify checksum when superblock is read for scan

2018-03-27 Thread Nikolay Borisov
On 27.03.2018 14:30, Nikolay Borisov wrote: > > > On 26.03.2018 11:27, Anand Jain wrote: >> During the scan context, we aren't verifying the superblock- >> checksum when read. >> This patch fixes it by adding the checksum verification function >> btrfs_c

Re: [PATCH 1/8] btrfs: cleanup btrfs_check_super_csum() for better code flow

2018-03-27 Thread Nikolay Borisov
; > Signed-off-by: Anand Jain <anand.j...@oracle.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > fs/btrfs/disk-io.c | 38 +- > 1 file changed, 17 insertions(+), 21 deletions(-) > > diff --git a/fs/btrfs/disk-i

Re: [PATCH 6/8] btrfs: verify checksum when superblock is read for scan

2018-03-27 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > During the scan context, we aren't verifying the superblock- > checksum when read. > This patch fixes it by adding the checksum verification function > btrfs_check_super_csum() in the function btrfs_read_disk_super(). > And makes device scan to error fail

Re: [PATCH 5/8] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-27 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > During the btrfs dev scan make sure that other copies of superblock > contain the same fsid as the primary SB. So that we bring to the > user notice if the superblock has been overwritten. > > mkfs.btrfs -fq /dev/sdc > mkfs.btrfs -fq /dev/sdb > dd

Re: [PATCH 3/8] btrfs: cleanup btrfs_read_disk_super() to return std error

2018-03-27 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > The only caller btrfs_scan_one_device() sets -EINVAL for error from > btrfs_read_disk_super(), so this patch returns -EINVAL from the latter > function. > > A preparatory patch to add csum check in btrfs_read_disk_super(). > > Signed-off-by: Anand Jain

Re: [PATCH 2/8] btrfs: return required error from btrfs_check_super_csum

2018-03-27 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > Return the required -EINVAL and -EUCLEAN from the function > btrfs_check_super_csum(). And more the error log into the > parent function. > > Signed-off-by: Anand Jain > --- > fs/btrfs/disk-io.c | 27 --- >

Re: [PATCH v2 1/2] btrfs-progs: print-tree: Use macro to replace immediate number for readable flags string buffer length

2018-03-27 Thread Nikolay Borisov
e > buffer size. > > Signed-off-by: Qu Wenruo <w...@suse.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > changelog: > v2: > Move all buffer length macros to the header part. > Change comment to refer to the buffer length marco f

[PATCH v2 1/4] btrfs-progs: Remove btrfs-debug-tree command

2018-03-27 Thread Nikolay Borisov
There is already a replacement in the face of btrfs inspect-internal dump-tree. And this command is just a simple wrapper around it. Just remove it and adjust the show-blocks script to call the main btrfs binary to achieve the same effect. Signed-off-by: Nikolay Borisov <nbori...@suse.

[PATCH v2 3/4] btrfs-progs: Remove deprecated btrfs-show-super

2018-03-27 Thread Nikolay Borisov
Its function has been superseded by btrfs inspect-internal show-super. Furthermore the tools is currently not built by default. Just remove it. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- .gitignore| 1 - Documentation/Makefile.in

[PATCH v2 4/4] btrfs-progs: Remove deprecated btrfs-calc-size tool

2018-03-27 Thread Nikolay Borisov
Its function has been superseded by btrfs inspect-internal tree-stats. Just remove it. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- .gitignore| 1 - Makefile | 2 +- btrfs-calc-size.c | 39 --- 3 files changed, 1 insertion(

[PATCH v2 2/4] btrfs-progs: Remove deprecated btrfs-zero-log standalone tool

2018-03-27 Thread Nikolay Borisov
Its function has been subsumed by "btrfs rescue zero-log". Remove its source file and adjust make/tests soruces accordingly. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- .gitignore| 1 - Documentation/Makefile.in | 1

[PATCH 02/10] btrfs-progs: Drop ext_ref param from check_dir_item

2018-03-27 Thread Nikolay Borisov
This parameter is no longer used in this function, so drop it Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index a8a2f76549a2..2c7b270a3ffa

[PATCH 03/10] btrfs-progs: Drop ext_ref argument from check_inode_item

2018-03-27 Thread Nikolay Borisov
We can derive this argument from root->fs_info and also make it local to the sole switch case it's used. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/check/mode-lowmem.c b/c

[PATCH 09/10] btrfs-progs: Remove ext_ref local variable from check_fs_roots_lowmem

2018-03-27 Thread Nikolay Borisov
All real consumers of that variable have inlined the checks since they are simple enough. So just remove it. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c

[PATCH 04/10] btrfs-progs: Drop unused ext_ref parameter from process_one_leaf

2018-03-27 Thread Nikolay Borisov
It's no longer used in the function so just remove it Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index e26e9bdf3bb3..34519f30a4aa 100644 --- a

[PATCH 01/10] btrfs-progs: Drop ext_ref parameter from find_inode_ref

2018-03-27 Thread Nikolay Borisov
This is a boolean parameter which signals whether the fs has the EXTENDED_IREF feature flag toggled or not. Since a reference to fs_info can be obtained there is no need to pollute the interface. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 13 ++

[PATCH 07/10] btrfs-progs: Drop ext_ref param from check_fs_first_inode

2018-03-27 Thread Nikolay Borisov
It's no longer used in that function so can be dropped altogether. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 76365a

[PATCH 05/10] btrfs-progs: Remove ext_ref param from check_fs_first_inode

2018-03-27 Thread Nikolay Borisov
It's no longer use and can be dropped. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 34519f30a4aa..29c55e202f2b 100644 --- a/check/mode-lo

[PATCH 10/10] btrfs-progs: Make __btrfs_fs_incompat return bool

2018-03-27 Thread Nikolay Borisov
First this function does the '!!' trick to turn its value into a bool, yet the return type is int. Second, the kernel counterpart also returns bool. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- ctree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctr

[PATCH 06/10] btrfs-progs: Remove ext_ref param from walk_down_tree

2018-03-27 Thread Nikolay Borisov
It's no longer used so just remove it. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- check/mode-lowmem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 29c55e202f2b..76365a214e34 100644 --- a/check/mode-lo

Re: [PATCH] btrfs-progs: wipe copies of the stale superblock beyond -b size

2018-03-27 Thread Nikolay Borisov
On 27.03.2018 02:50, Anand Jain wrote: > > >> I told you this code can be made a lot simpler, simply by modifying the >> last argument passed to zero_dev_clamped. I even posted the resulting >> diff which was just 3 lines changed. >> >> I agree that it's a good idea to wipe all available

Re: [PATCH] btrfs-progs: wipe copies of the stale superblock beyond -b size

2018-03-26 Thread Nikolay Borisov
On 26.03.2018 11:27, Anand Jain wrote: > During the mkfs.btrfs -b btrfs_prepare_device() zeros all > the superblock bytenr locations only if the bytenr is below the > blockcount. The problem with this is that if the BTRFS is recreated > with a smaller size then we will leave the stale

Re: [PATCH 2/2] btrfs-progs: Add test for collision DIR_ITEM handling

2018-03-26 Thread Nikolay Borisov
On 25.03.2018 14:44, Qu Wenruo wrote: > > > On 2018年03月23日 22:48, Nikolay Borisov wrote: >> Verify that if we have an otherwise clean filesystem, containging collided >> DIR_ITEM, btrfs check lowmem's mode can correctly handle those and not >> pro

Re: [PATCH v2 1/3] btrfs: Move may_destroy_subvol() from ioctl.c to inode.c

2018-03-26 Thread Nikolay Borisov
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/ctree.h | 1 + > fs/btrfs/inode.c | 54 ++

[PATCH 1/2] btrfs-progs: Fix DIR_ITEM checking in lowmem

2018-03-23 Thread Nikolay Borisov
NIP- Fix this by moving the code setting index at the beginning of the while loop. This ensure that for each item in DIR_ITEM we have index set correctly. Fixes: 564901eac7a4 ("btrfs-progs: check: introduce print_dir_item_err()") Signed-off-by: Nikolay Borisov <n

[PATCH 2/2] btrfs-progs: Add test for collision DIR_ITEM handling

2018-03-23 Thread Nikolay Borisov
Verify that if we have an otherwise clean filesystem, containging collided DIR_ITEM, btrfs check lowmem's mode can correctly handle those and not produce any false positives. This if fixed by commit titled: "btrfs-progs: Fix DIR_ITEM checking in lowmem" Signed-off-by: Nikolay Bori

Re: [PATCH v2] btrfs: Validate child tree block's level and first key

2018-03-23 Thread Nikolay Borisov
On 23.03.2018 03:31, Qu Wenruo wrote: > We have several reports about node pointer points to incorrect child > tree blocks, which could have even wrong owner and level but still with > valid generation and checksum. > > Although btrfs check could handle it and print error message like: > leaf

Re: [PATCH] btrfs: Allow rmdir(2) to delete a subvolume

2018-03-23 Thread Nikolay Borisov
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 from > ioctl.c to inode.c and named as btrfs_delete_subvolume(), which is > also called in

Re: [PATCH] btrfs: Validate child tree block's level and first key

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 16:26, Qu Wenruo wrote: > > > On 2018年03月22日 22:20, Nikolay Borisov wrote: >> >> >> On 22.03.2018 16:17, Qu Wenruo wrote: >>> >>> >>> On 2018年03月22日 22:00, David Sterba wrote: >>>> On Thu, Mar 22, 2018 at 09:53:46

Re: [PATCH] btrfs: Validate child tree block's level and first key

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 16:17, Qu Wenruo wrote: > > > On 2018年03月22日 22:00, David Sterba wrote: >> On Thu, Mar 22, 2018 at 09:53:46PM +0800, Qu Wenruo wrote: > diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c > index 26484648d090..3866b8ab20f1 100644 > --- a/fs/btrfs/backref.c > +++

Re: [PATCH 1/3] btrfs-progs: Remove deprecated btrfs-zero-log standalone tool

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 15:31, David Sterba wrote: > On Thu, Mar 22, 2018 at 09:29:46PM +0800, Qu Wenruo wrote: >> >> >> On 2018年03月22日 21:18, Nikolay Borisov wrote: >>> Its function has been subsumed by "btrfs rescue zero-log". Remove its >>> sour

[PATCH 3/3] btrfs-progs: Remove deprecated btrfs-calc-size tool

2018-03-22 Thread Nikolay Borisov
Its function has been superseded by btrfs inspect-internal tree-stats. Just remove it. --- Makefile | 2 +- btrfs-calc-size.c | 39 --- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 btrfs-calc-size.c diff --git a/Makefile

[PATCH 2/3] btrfs-progs: Remove deprecated btrfs-show-super

2018-03-22 Thread Nikolay Borisov
Its function has been superseded by btrfs inspect-internal show-super. Furthermore the tools is currently not built by default. Just remove it. --- Makefile | 2 +- btrfs-show-super.c | 39 --- 2 files changed, 1 insertion(+), 40 deletions(-) delete

[PATCH 1/3] btrfs-progs: Remove deprecated btrfs-zero-log standalone tool

2018-03-22 Thread Nikolay Borisov
Its function has been subsumed by "btrfs rescue zero-log". Remove its source file and adjust make/tests soruces accordingly. --- Makefile | 4 +- btrfs-zero-log.c | 78 --- tests/misc-tests.sh |

Re: [PATCH v2] btrfs-progs: wipe stale sb copy beyond -b size

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 15:01, Anand Jain wrote: > During the mkfs.btrfs -b btrfs_prepare_device() zeros all > the superblock bytenr locations only if the bytenr is below the > blockcount. The problem with this is that if the BTRFS is recreated > with a smaller size then we will leave the stale

Re: [PATCH v2] btrfs: check if the fsid in the primary sb and copy sb are same

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 15:01, Anand Jain wrote: > During the btrfs dev scan make sure that other copies of superblock > contain the same fsid as the primary SB. So that we bring to the > users notice if the superblock has been overwritten. > > mkfs.btrfs -fq /dev/sdc > mkfs.btrfs -fq /dev/sdb > dd

Re: [PATCH] btrfs-progs: wipe all copies of the stale superblock

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 14:14, Anand Jain wrote: > > >  Ok. Will update the change log. > >> A better place for this code is really inside btrfs_wipe_existing_sb. >> Furthermore looking at libblkid it supports a way to wipe multiple >> superblocks by way of: blkid_do_wipe. I.e >>

Re: [PATCH] btrfs: Validate child tree block's level and first key

2018-03-22 Thread Nikolay Borisov
On 19.03.2018 11:18, Qu Wenruo wrote: > We have several reports about node pointer points to incorrect child > tree blocks, which could have even wrong owner and level but still with > valid generation and checksum. > > Although btrfs check could handle it and print error message like: > leaf

Re: [PATCH 1/2] btrfs-progs: print-tree: Use macro to replace immediate number for readable flags string buffer length

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 10:32, Qu Wenruo wrote: > > > On 2018年03月22日 16:20, Nikolay Borisov wrote: >> >> >> On 22.03.2018 09:37, Qu Wenruo wrote: >>> In print-tree, we have a lot of parsers to convert numeric flags to >>> human readable string. >>>

Re: [PATCH 2/2] btrfs-progs: print-tree: Add output for node flags and backref version

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 09:37, Qu Wenruo wrote: > Just like what we did for leaf, also add this output to make it easier > to distinguish tree reloc tree blocks. > > Signed-off-by: Qu Wenruo <w...@suse.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > print

Re: [PATCH 1/2] btrfs-progs: print-tree: Use macro to replace immediate number for readable flags string buffer length

2018-03-22 Thread Nikolay Borisov
On 22.03.2018 09:37, Qu Wenruo wrote: > In print-tree, we have a lot of parsers to convert numeric flags to > human readable string. > > For the buffer size we're using immediate numbers for all their callers. > Change this to macro so it will be much easier for us to expand the > buffer size.

Re: [PATCH] btrfs-progs: wipe all copies of the stale superblock

2018-03-21 Thread Nikolay Borisov
On 21.03.2018 12:19, Anand Jain wrote: > Recovering from the other copies of the superblock is fundamental > to BTRFS, which provides resilient against single LBA failure in nit: s/resilient/resilience. > the DUP group profile. Furthermore, the number of superblock copies doesn't really depend

[PATCH 5/8] btrfs: Open-code add_delayed_data_ref

2018-03-21 Thread Nikolay Borisov
. 2. The only piece of code that remains in the critical section is insert_delayed_ref call. 3. Tracing and memory freeing code is moved outside of the critical section. No functional changes, just an overall shorter critical section. Signed-off-by: Nikolay Borisov <nbori...@suse.com> -

[PATCH 4/8] btrfs: Open-code add_delayed_tree_ref

2018-03-21 Thread Nikolay Borisov
of view - the code is unchanged. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 66 -- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 7ec228

[PATCH 8/8] btrfs: split delayed ref head initialization and addition

2018-03-21 Thread Nikolay Borisov
onally it's equivalent to the old WARN_ON and allows to remove the two args from add_delayed_ref_head. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/bt

[PATCH 6/8] btrfs: Introduce init_delayed_ref_head

2018-03-21 Thread Nikolay Borisov
. Begin untangling it by first extracting the initialization only code in its own function. It's more or less verbatim copy of the first part of add_delayed_ref_head. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 68 +++

[PATCH 0/8] Delayed refs cleanups/streamlining

2018-03-21 Thread Nikolay Borisov
as somewhat reduced critical section under delayed_refs->lock spinlock. Nikolay Borisov (8): btrfs: Factor out common delayed refs init code btrfs: Use init_delayed_ref_common in add_delayed_tree_ref btrfs: Use init_delayed_ref_common in add_delayed_data_ref btrfs: Open-c

[PATCH 2/8] btrfs: Use init_delayed_ref_common in add_delayed_tree_ref

2018-03-21 Thread Nikolay Borisov
Use the newly introduced common helper. No functional changes Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 35 +++ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed

[PATCH 7/8] btrfs: Use init_delayed_ref_head in add_delayed_ref_head

2018-03-21 Thread Nikolay Borisov
Use the newly introduced function when initialising the head_ref in add_delayed_ref_head. No functional changes. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 62 -- 1 file changed, 4 insertions(+), 58 del

[PATCH 1/8] btrfs: Factor out common delayed refs init code

2018-03-21 Thread Nikolay Borisov
THe majority of the init code for struct btrfs_delayed_ref_node is duplicated in add_delayed_data_ref and add_delayed_tree_ref. Factor out the common bits in init_delayed_ref_common. This function is going to be used in future patches to clean that up. No functional changes Signed-off-by: Nikolay

[PATCH 3/8] btrfs: Use init_delayed_ref_common in add_delayed_data_ref

2018-03-21 Thread Nikolay Borisov
Use the newly introduced helper and remove the duplicate code. No functional changes Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- fs/btrfs/delayed-ref.c | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/fs/btrfs/delayed-ref.

Re: [PATCH] btrfs: Allow non-privileged user to delete empty subvolume by default

2018-03-21 Thread Nikolay Borisov
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 subvolume even if it is not empty >> and may cause data loss. In other words, when

Re: [PATCH] btrfs: Remove obsolete function declaration

2018-03-21 Thread Nikolay Borisov
On 21.03.2018 09:16, Qu Wenruo wrote: > > > On 2018年03月21日 15:03, Nikolay Borisov wrote: >> This function was removed in 24bc2843edd5 ("btrfs: >> Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index()") what >> remains is a defunct declaration. Remo

[PATCH] btrfs: Remove obsolete function declaration

2018-03-21 Thread Nikolay Borisov
This function was removed in 24bc2843edd5 ("btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index()") what remains is a defunct declaration. Remove it. Signed-off-by: Nikolay Borisov <nbori...@suse.com> --- David, This is a fixlet to the aforementioned patch which

Re: [PATCH 2/2] btrfs: defer adding raid type kobject until after chunk relocation

2018-03-21 Thread Nikolay Borisov
On 20.03.2018 21:25, je...@suse.com wrote: > From: Jeff Mahoney > > Any time the first block group of a new type is created, we add a new > kobject to sysfs to hold the attributes for that type. Kobject-internal > allocations always use GFP_KERNEL, making them prone to

Re: [PATCH 1/2] btrfs: remove dead create_space_info calls

2018-03-21 Thread Nikolay Borisov
part from mount time. I'm glad you were able to prove it's not really done at any other time. Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > fs/btrfs/ctree.h | 6 +++--- > fs/btrfs/extent-tree.c | 16 ++-- > 2 files changed, 5 insertions(+), 17

Re: [PATCH v2 2/2] btrfs: return required error from btrfs_check_super_csum

2018-03-21 Thread Nikolay Borisov
On 21.03.2018 01:33, Anand Jain wrote: > Return the required -EINVAL and -EUCLEAN from the function > btrfs_check_super_csum(). And more the error log into the > parent function. > > Signed-off-by: Anand Jain > --- > fs/btrfs/disk-io.c | 28 +---

Re: [PATCH v2 1/2] btrfs: cleanup btrfs_check_super_csum() to check the csum_type to the type

2018-03-21 Thread Nikolay Borisov
gned-off-by: Anand Jain <anand.j...@oracle.com> Reviewed-by: Nikolay Borisov <nbori...@suse.com> > --- > fs/btrfs/disk-io.c | 41 +++-- > 1 file changed, 19 insertions(+), 22 deletions(-) > > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs

Re: [PATCH 3/3] btrfs: refactor btrfs_check_super_csum() for scan

2018-03-20 Thread Nikolay Borisov
On 20.03.2018 11:53, Anand Jain wrote: > In preparation to use the function btrfs_check_super_csum() for > the device scan context, make it nonstatic and pass the > struct block_device instead of the struct fs_info. > > Signed-off-by: Anand Jain > --- >

Re: [PATCH 1/3] btrfs: cleanup btrfs_check_super_csum() to check the csum_type to the type

2018-03-20 Thread Nikolay Borisov
On 20.03.2018 12:11, Nikolay Borisov wrote: > > > On 20.03.2018 11:53, Anand Jain wrote: >> %csum_type is being checked to check the number of csum types we support, >> which is 1 as of now. Instead just check if the type matches with the >> only type we support, th

Re: [PATCH 2/3] btrfs: return required error from btrfs_check_super_csum

2018-03-20 Thread Nikolay Borisov
On 20.03.2018 11:53, Anand Jain wrote: > Return the required -EINVAL from the function btrfs_check_super_csum() > and move the error logging into the btrfs_check_super_csum() itself. > > Signed-off-by: Anand Jain > --- > fs/btrfs/disk-io.c | 13 +++-- > 1 file

Re: [PATCH 1/3] btrfs: cleanup btrfs_check_super_csum() to check the csum_type to the type

2018-03-20 Thread Nikolay Borisov
On 20.03.2018 11:53, Anand Jain wrote: > %csum_type is being checked to check the number of csum types we support, > which is 1 as of now. Instead just check if the type matches with the > only type we support, that is BTRFS_CSUM_TYPE_CRC32. And further adds > cleanup. > > Signed-off-by: Anand

Re: [PATCH] btrfs-progs: print-tree: Do correct offset output for ROOT_ITEM

2018-03-19 Thread Nikolay Borisov
offset. > > For tree reloc tree, it's indeed subvolume id. > But for other trees, it's the transid of when it's created. > > Fix it. > > Reported-by: Nikolay Borisov <nbori...@suse.com> > Signed-off-by: Qu Wenruo <w...@suse.com> > --- > print-t

Re: High CPU usage of RT threads...

2018-03-19 Thread Nikolay Borisov
On 19.03.2018 13:48, Shyam Prasad N wrote: > On Mon, Mar 19, 2018 at 4:37 PM, Nikolay Borisov <nbori...@suse.com> wrote: >> >> >> On 19.03.2018 13:02, Shyam Prasad N wrote: >>> Hi, >>> >>> Attaching the sysrq-trigger output. >> >

Re: [PATCH] btrfs-progs: print-tree: Do correct offset output for ROOT_ITEM

2018-03-19 Thread Nikolay Borisov
On 19.03.2018 12:54, Nikolay Borisov wrote: > > > On 19.03.2018 12:50, Qu Wenruo wrote: >> What about this value? >> 18446744073709551607 >> >> It's data reloc tree objectid. >> And it's pretty long since it's -9ULL. >> >> At least th

Re: [PATCH] btrfs-progs: print-tree: Do correct offset output for ROOT_ITEM

2018-03-19 Thread Nikolay Borisov
On 19.03.2018 12:50, Qu Wenruo wrote: > What about this value? > 18446744073709551607 > > It's data reloc tree objectid. > And it's pretty long since it's -9ULL. > > At least this makes 2 objectid more readable. Fair enough. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] btrfs-progs: print-tree: Do correct offset output for ROOT_ITEM

2018-03-19 Thread Nikolay Borisov
offset. > > For tree reloc tree, it's indeed subvolume id. > But for other trees, it's the transid of when it's created. > > Fix it. > > Reported-by: Nikolay Borisov <nbori...@suse.com> > Signed-off-by: Qu Wenruo <w...@suse.com> > --- > print-t

Re: Kernel warning - not sure if this is important

2018-03-19 Thread Nikolay Borisov
On 19.03.2018 10:21, Peter Chant wrote: > I got this kernel warning overnight. Possibly during or after a dedup > using duperemove. I'm not sure if that is relevent. Seems to relate to > fs/btrfs/backref.c line 1266. > > Don't know if it is important. Thought I'd post it just in case. > >

Re: High CPU usage of RT threads...

2018-03-19 Thread Nikolay Borisov
anything else you can think of, based > on the above data. > > Regards, > Shyam > > > On Thu, Mar 15, 2018 at 12:59 PM, Nikolay Borisov <nbori...@suse.com> wrote: >> >> >> On 15.03.2018 09:23, Shyam Prasad N wrote: >>> Hi, >>> >>> Our se

Re: [PATCH] btrfs: fix lockdep splat in btrfs_alloc_subvolume_writers

2018-03-16 Thread Nikolay Borisov
On 16.03.2018 20:36, je...@suse.com wrote: > From: Jeff Mahoney > > While running btrfs/011, I hit the following lockdep splat. > > This is the important bit: >pcpu_alloc+0x1ac/0x5e0 >__percpu_counter_init+0x4e/0xb0 >btrfs_init_fs_root+0x99/0x1c0 [btrfs] >

<    5   6   7   8   9   10   11   12   13   14   >