[PATCH] btrfs-progs: Fix NULL pointer when receive clone operation

2016-12-14 Thread Qu Wenruo
The subvol_info returned from subvol_uuid_search() can be NULL. So the branch checking IS_ERR(si) should also check if it's NULL. Reported-by: Tsutomu Itoh Signed-off-by: Qu Wenruo --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-recei

[GIT PULL] btrfs fixes and cleanups

2016-12-14 Thread Liu Bo
Hi David, This is the collection of my patches targetting 4.10, I've dropped patch "Btrfs: adjust len of writes if following a preallocated extent" because of the deadlock caused by this commit. Patches are based on v4.9-rc8, and test against fstests with default mount options has been taken to m

[PATCH] Btrfs: fix another race between truncate and lockless dio write

2016-12-14 Thread Liu Bo
Dio writes can update i_size in btrfs_get_blocks_direct when it writes to offset beyond EOF so that endio can update disk_i_size correctly (because we don't udpate disk_i_size beyond i_size). However, when truncating down a file, we firstly update i_size and then wait for in-flight lockless dio re

Re: Btrfs progs pre-release 4.9-rc1

2016-12-14 Thread Tsutomu Itoh
On 2016/12/14 23:42, David Sterba wrote: > Hi, > > a pre-release has been tagged. Contains almost the entire devel branch from > today. There are small fixes, the lowmem mode of check gets more updates but > still does not work in the --repair mode and is considered experimental. > > ETA for 4.9

[PATCH v2] btrfs-progs: tests: add test for --sync option of qgroup show

2016-12-14 Thread Tsutomu Itoh
Simple test script for the following patch. btrfs-progs: qgroup: add sync option to 'qgroup show' Signed-off-by: Tsutomu Itoh --- v2: dropped the test of --no-sync --- tests/cli-tests/005-qgroup-show-sync/test.sh | 30 1 file changed, 30 insertions(+) create mod

[PATCH v3 2/2] btrfs-progs: qgroup: change the value of sort option

2016-12-14 Thread Tsutomu Itoh
The value of sort option ('S') is not used for option letter. Therefore, I'll change the single letter to non-character. Signed-off-by: Tsutomu Itoh --- This patch is separated from patch of --sync option. --- cmds-qgroup.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH v3 1/2] btrfs-progs: qgroup: add sync option to 'qgroup show'

2016-12-14 Thread Tsutomu Itoh
The 'qgroup show' command does not synchronize filesystem. Therefore, 'qgroup show' may not display the correct value unless synchronized with 'filesystem sync' command etc. So add the '--sync' option so that we can choose whether or not to synchronize when executing the command. Signed-off-by: T

Re: [PATCH v2] btrfs-progs: qgroup: add sync option to 'qgroup show'

2016-12-14 Thread Tsutomu Itoh
Hi David, Thanks for the review. On 2016/12/14 19:54, David Sterba wrote: > On Wed, Dec 07, 2016 at 04:55:15PM +0900, Tsutomu Itoh wrote: >> The 'qgroup show' command does not synchronize filesystem. >> Therefore, 'qgroup show' may not display the correct value unless >> synchronized with 'filesy

Re: page allocation stall in kernel 4.9 when copying files from one btrfs hdd to another

2016-12-14 Thread Xin Zhou
Hi, The dirty data is in large amount, probably unable to commit to disk. And this seems to happen when copying from 7200rpm to 5600rpm disks, according to previous post. Probably the I/Os are buffered and pending, unable to get finished in-time. It might be helpful to know if this only happens

Re: [PATCH] duperemove: test presence of dedupe ioctl

2016-12-14 Thread Christoph Hellwig
On Wed, Dec 14, 2016 at 10:38:45AM -0800, Darrick J. Wong wrote: > > > +struct fake_btrfs_ioctl_same_args { > > > + struct btrfs_ioctl_same_args args; > > > + struct btrfs_ioctl_same_extent_info info; > > > +}; > > > > Why does this need a fake structure here? > > In order to test the ioctl we ha

Re: [PATCH] Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly

2016-12-14 Thread Liu Bo
On Thu, Dec 01, 2016 at 01:46:10PM -0800, Liu Bo wrote: > btrfs_ordered_update_i_size can be called by truncate and endio, but only > endio > takes ordered_extent which contains the completed IO. > > while truncating down a file, if there are some in-flight IOs, > btrfs_ordered_update_i_size in e

Re: [PATCH] duperemove: test presence of dedupe ioctl

2016-12-14 Thread Darrick J. Wong
On Wed, Dec 14, 2016 at 02:44:36AM -0800, Christoph Hellwig wrote: > On Fri, Dec 09, 2016 at 09:56:45AM -0800, Darrick J. Wong wrote: > > Since a zero-length dedupe operation is guaranteed to succeed, use that > > to test whether or not this filesystem supports dedupe. > > > > Signed-off-by: Darri

Btrfs progs pre-release 4.9-rc1

2016-12-14 Thread David Sterba
Hi, a pre-release has been tagged. Contains almost the entire devel branch from today. There are small fixes, the lowmem mode of check gets more updates but still does not work in the --repair mode and is considered experimental. ETA for 4.9 is in +6 days (2016-12-20). Minor fixes, docs improvem

[RFC] btrfs: lockdep says "possible recursive locking detected" in btrfs_clear_lock_blocking_rw()

2016-12-14 Thread Sebastian Andrzej Siewior
With lockdep enabled I managed to trigger the following lockdep splat: | = | [ INFO: possible recursive locking detected ] | 4.9.0-rt0 #804 Tainted: GW | - | kworker/u16:4/154 is trying to acquire

[PATCH 2/2] btrfs: swap free() and trace point in run_ordered_work()

2016-12-14 Thread Sebastian Andrzej Siewior
The previous patch removed a trace point due to a use after free problem with tracing enabled. While looking at the backtrace it took me a while to find the right spot. While doing so I noticed that this trace point could be used after one of two clean-up functions were invoked: - run_one_async_fre

[PATCH 1/2] btrfs: drop trace_btrfs_all_work_done() from normal_work_helper()

2016-12-14 Thread Sebastian Andrzej Siewior
For btrfs_scrubparity_helper() the ->func() is set to scrub_parity_bio_endio_worker(). This functions invokes scrub_free_parity() which kfrees() the `work' object. All is good as long as trace events are not enabled because we boom with a backtrace like this: | Workqueue: btrfs-endio btrfs_endio_he

Re: [PATCH 0/4] Lowmem fsck false alert fixes

2016-12-14 Thread David Sterba
On Mon, Dec 05, 2016 at 05:07:52PM +0800, Qu Wenruo wrote: > Btrfs-progs test case 023 will cause assert and a lot of false alerts > for lowmem mode. > > The problems are caused by several reasons, from bad handler for tree > reloc root(calling btrfs_read_fs_root on tree reloc tree) to too > restr

Re: [PATCH 1/2] btrfs-progs: btrfs-convert: Prevent accounting blocks beyond end of device

2016-12-14 Thread David Sterba
On Fri, Dec 09, 2016 at 09:03:57AM +0800, Qu Wenruo wrote: > Hi Chandan, > > Thanks for the patch. > > At 12/08/2016 09:56 PM, Chandan Rajendra wrote: > > When looping across data block bitmap, __ext2_add_one_block() may add > > blocks which do not exist on the underlying disk. This commit preven

Re: [PATCH 2/2] btrfs-convert: Fix migrate_super_block() to work with 64k sectorsize

2016-12-14 Thread David Sterba
On Fri, Dec 09, 2016 at 09:09:29AM +0800, Qu Wenruo wrote: > > > At 12/08/2016 09:56 PM, Chandan Rajendra wrote: > > migrate_super_block() uses sectorsize to refer to the size of the > > superblock. Hence on 64k sectorsize filesystems, it ends up computing > > checksum beyond the super block leng

Re: page allocation stall in kernel 4.9 when copying files from one btrfs hdd to another

2016-12-14 Thread admin
Hi, I verified the log files and see no prior oom killer invocation. Unfortunately the machine has been rebooted since. Next time it happens, I will also look in dmesg. Thanks, David Arendt Michal Hocko – Wed., 14. December 2016 11:31 > Btw. the stall should be preceded by the OOM killer inv

Re: [PATCH v2] btrfs-progs: qgroup: add sync option to 'qgroup show'

2016-12-14 Thread David Sterba
On Wed, Dec 07, 2016 at 04:55:15PM +0900, Tsutomu Itoh wrote: > The 'qgroup show' command does not synchronize filesystem. > Therefore, 'qgroup show' may not display the correct value unless > synchronized with 'filesystem sync' command etc. > > So add the '--sync' and '--no-sync' options so that

Re: [PATCH] duperemove: test presence of dedupe ioctl

2016-12-14 Thread Christoph Hellwig
On Fri, Dec 09, 2016 at 09:56:45AM -0800, Darrick J. Wong wrote: > Since a zero-length dedupe operation is guaranteed to succeed, use that > to test whether or not this filesystem supports dedupe. > > Signed-off-by: Darrick J. Wong > --- > file_scan.c | 47 +

Re: page allocation stall in kernel 4.9 when copying files from one btrfs hdd to another

2016-12-14 Thread Michal Hocko
Btw. the stall should be preceded by the OOM killer invocation. Could you share the OOM report please. I am asking because such an OOM killer would be clearly pre-mature as per your meminfo. I am trying to change that code and seeing your numbers might help me. Thanks! On Wed 14-12-16 11:17:43, M

Re: page allocation stall in kernel 4.9 when copying files from one btrfs hdd to another

2016-12-14 Thread Michal Hocko
On Tue 13-12-16 18:11:01, David Arendt wrote: > Hi, > > I receive the following page allocation stall while copying lots of > large files from one btrfs hdd to another. > > Dec 13 13:04:29 server kernel: kworker/u16:8: page allocation stalls for > 12260ms, order:0, mode:0x2400840(GFP_NOFS|__GFP_