Re: send | receive: received snapshot is missing recent files

2017-09-06 Thread A L
The problem can be that you have a Received UUID on the source volume. This breaks send-receive. From: Dave -- Sent: 2017-09-07 - 06:43 > Here is more info and a possible (shocking) explanation. This > aggregates my prior messages and it provides an almost complete set of > steps to r

Re: send | receive: received snapshot is missing recent files

2017-09-06 Thread Dave
Here is more info and a possible (shocking) explanation. This aggregates my prior messages and it provides an almost complete set of steps to reproduce this problem. Linux srv 4.9.41-1-lts #1 SMP Mon Aug 7 17:32:35 CEST 2017 x86_64 GNU/Linux btrfs-progs v4.12 My steps: [root@srv]# sync [root@srv

[PATCH v2] btrfs-progs: print: Check on num_stripes in print_chunk

2017-09-06 Thread Su Yue
From: Zhang Yu In fuzz-tests/004-simple-dump-tree: Since there is one wrong item(DATA_RELOC_TREE CHUNK_ITEM 0) in root tree. It fails as follow: ctree.h:317: btrfs_chunk_item_size: BUG_ON `num_stripes == 0` triggered, value 1 btrfs-progs/btrfs(+0x2496f)[0x564a031e996f] btrfs-progs/btrfs(print_ch

[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 --- change log: v1 -> v2:

Re: [PATCH] Btrfs: avoid wake_up if possible

2017-09-06 Thread Liu Bo
On Wed, Sep 06, 2017 at 04:19:04PM +0200, David Sterba wrote: > On Fri, Sep 01, 2017 at 04:14:27PM -0600, Liu Bo wrote: > > wake_up() will go to check whether someone is on the waiting list with > > holding spin_lock(). > > > > Around some btrfs code, we don't check waitqueue_active() firstly, so >

Re: [PATCH] btrfs-progs: Add zstd support

2017-09-06 Thread Nick Terrell
On 9/4/17, 11:03 AM, "linux-btrfs-ow...@vger.kernel.org on behalf of David Sterba" wrote: > On Wed, Aug 30, 2017 at 02:53:22PM -0700, Nick Terrell wrote: > > Adds zstd support to the btrfs program, and a dependency on libzstd >= > > 1.0.0. > > I'm afraid we'll have to make the build optional for

Re: [PATCH] Btrfs: use the new helper wbc_to_write_flags

2017-09-06 Thread Liu Bo
On Wed, Sep 06, 2017 at 04:38:06PM +0200, David Sterba wrote: > On Thu, Aug 24, 2017 at 06:19:48PM -0600, Liu Bo wrote: > > This updates btrfs to use the helper wbc_to_write_flags which has been > > applied in ext4/xfs/f2fs/block. > > Added in commit 7637241e651ec36e4094 in 11/2016, I wonder why b

Re: send | receive: received snapshot is missing recent files

2017-09-06 Thread Dave
This is an even better set of steps for reproducing the problem. [root@srv]# sync [root@srv]# mkdir /home/.snapshots/test1 [root@srv]# btrfs su sn -r /home/ /home/.snapshots/test1/ Create a readonly snapshot of '/home/' in '/home/.snapshots/test1//home' [root@srv]# sync [root@srv]# mkdir /mnt/x5a/

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Austin S. Hemmelgarn
On 2017-09-06 14:31, Goffredo Baroncelli wrote: On 09/06/2017 08:02 PM, Austin S. Hemmelgarn wrote: On 2017-09-06 13:48, Goffredo Baroncelli wrote: On 09/06/2017 07:16 PM, Austin S. Hemmelgarn wrote: [...] Sorry but I don't understand. If you reach the step a3; you have: - the final disk, and

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Goffredo Baroncelli
On 09/06/2017 05:20 AM, Qu Wenruo wrote: >> >> BTW I compiled successfully the patches, and these seems to work. >> >> PS: I tried to cross-compile mkfs.btrfs ton arm, but mkfs.btrfs was unable >> to work: >> >> $ uname -a >> Linux bananapi 4.4.66-bananian #2 SMP Sat May 6 19:26:50 UTC 2017 armv7l

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Goffredo Baroncelli
On 09/06/2017 08:02 PM, Austin S. Hemmelgarn wrote: > On 2017-09-06 13:48, Goffredo Baroncelli wrote: >> On 09/06/2017 07:16 PM, Austin S. Hemmelgarn wrote: [...] Sorry but I don't understand. If you reach the step a3; you have: - the final disk, and an environment fully working. So I am

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Austin S. Hemmelgarn
On 2017-09-06 13:48, Goffredo Baroncelli wrote: On 09/06/2017 07:16 PM, Austin S. Hemmelgarn wrote: On 2017-09-06 12:43, Goffredo Baroncelli wrote: On 09/06/2017 01:31 PM, Austin S. Hemmelgarn wrote: On 2017-09-05 15:05, Goffredo Baroncelli wrote: On 09/05/2017 10:19 AM, Qu Wenruo wrote: O

Re: [PATCH] Btrfs-progs: Check on num_stripes in print_chunk

2017-09-06 Thread David Sterba
On Thu, Aug 24, 2017 at 06:38:41PM +0800, zhangyu-f...@cn.fujitsu.com wrote: > From: Zhang Yu > > [TEST/fuzz] case: 004-simple-dump-tree > > Since the wrong key(DATA_RELOC_TREE CHUNK_ITEM 0) in root tree, > error calling print_chunk(), resulting in num_stripes == 0. > > ERROR: > [TEST/fuzz

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Goffredo Baroncelli
On 09/06/2017 07:16 PM, Austin S. Hemmelgarn wrote: > On 2017-09-06 12:43, Goffredo Baroncelli wrote: >> On 09/06/2017 01:31 PM, Austin S. Hemmelgarn wrote: >>> On 2017-09-05 15:05, Goffredo Baroncelli wrote: On 09/05/2017 10:19 AM, Qu Wenruo wrote: > > > On 2017年09月05日 02:08, Davi

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

2017-09-06 Thread David Sterba
On Tue, Sep 05, 2017 at 02:53:15PM +0900, Misono, Tomohiro wrote: > 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 sub

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Austin S. Hemmelgarn
On 2017-09-06 12:43, Goffredo Baroncelli wrote: On 09/06/2017 01:31 PM, Austin S. Hemmelgarn wrote: On 2017-09-05 15:05, Goffredo Baroncelli wrote: On 09/05/2017 10:19 AM, Qu Wenruo wrote: On 2017年09月05日 02:08, David Sterba wrote: On Mon, Sep 04, 2017 at 03:41:05PM +0900, Qu Wenruo wrote:

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Goffredo Baroncelli
On 09/06/2017 01:31 PM, Austin S. Hemmelgarn wrote: > On 2017-09-05 15:05, Goffredo Baroncelli wrote: >> On 09/05/2017 10:19 AM, Qu Wenruo wrote: >>> >>> >>> On 2017年09月05日 02:08, David Sterba wrote: On Mon, Sep 04, 2017 at 03:41:05PM +0900, Qu Wenruo wrote: > mkfs.btrfs --rootdir provides

[PATCH] Btrfs: only check delayed ref usage in should_end_transaction

2017-09-06 Thread josef
From: Josef Bacik We were only doing btrfs_check_space_for_delayed_refs() if the metadata space was full, ie we couldn't allocate chunks. This assumes we'll be able to allocate chunks during transaction commit, but since nothing does a LIMIT flush during the transaction commit this won't actuall

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

2017-09-06 Thread David Sterba
On Tue, Sep 05, 2017 at 02:50:03PM +0900, Misono, Tomohiro wrote: > 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

Re: [PATCH v2] btrfs-progs: test/mkfs: Add test case for rootdir parameter

2017-09-06 Thread David Sterba
On Tue, Sep 05, 2017 at 10:24:15AM +0900, Qu Wenruo wrote: > Add test case which checks if -r|--rootdir mount option can handle > softlink/char/block/fifo files. > > Signed-off-by: Qu Wenruo Applied fix some fixups, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs

Re: [PATCH 5/7] Btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

2017-09-06 Thread David Sterba
On Tue, Aug 22, 2017 at 11:46:03PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > A naked read of the value of an RCU pointer isn't safe. Put the whole > access in an RCU critical section, not just the pointer dereference. In this case it is safe, as the device will not go away (and poten

Re: [PATCH 6/7] Btrfs: make some volumes.c functions static

2017-09-06 Thread David Sterba
On Tue, Aug 22, 2017 at 11:46:04PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > These aren't used outside of volumes.c. > > Signed-off-by: Omar Sandoval > --- > fs/btrfs/volumes.c | 14 -- > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/fs/btrfs/volumes

Re: [PATCH 7/7] Btrfs: fix __user casting in ioctl.c

2017-09-06 Thread David Sterba
On Tue, Aug 22, 2017 at 11:46:05PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > Signed-off-by: Omar Sandoval Reviewed-by: David Sterba -- 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

Re: [PATCH 3/7] Move Btrfs RCU string to common library

2017-09-06 Thread David Sterba
On Tue, Aug 22, 2017 at 11:46:01PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > The RCU-friendly string API used internally by Btrfs is generic enough > for common use. This doesn't add any new functionality but instead just > moves the code and documents the existing API. Ok for the ch

Re: [PATCH 2/7] Btrfs: fix incorrect {node,sector}size endianness from BTRFS_IOC_FS_INFO

2017-09-06 Thread David Sterba
On Tue, Aug 22, 2017 at 11:46:00PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > fs_info->super_copy->{node,sector}size are little-endian, but the ioctl > should return the values in native endianness. Use the cached values in > btrfs_fs_info instead. Found with sparse. > > Fixes: 80a773

Re: [PATCH] Btrfs: do not reset bio->bi_ops while writing bio

2017-09-06 Thread David Sterba
On Wed, Aug 23, 2017 at 12:15:09PM -0600, Liu Bo wrote: > flush_epd_write_bio() sets bio->bi_ops by itself to honor REQ_SYNC, > but it's not needed at all since bio->bi_ops has set up properly in > both __extent_writepage() and write_one_eb(), and in the case of > write_one_eb(), it also sets REQ_M

Re: [PATCH] Btrfs: use the new helper wbc_to_write_flags

2017-09-06 Thread David Sterba
On Thu, Aug 24, 2017 at 06:19:48PM -0600, Liu Bo wrote: > This updates btrfs to use the helper wbc_to_write_flags which has been > applied in ext4/xfs/f2fs/block. Added in commit 7637241e651ec36e4094 in 11/2016, I wonder why btrfs wasn't been changed as well as it uses the same code patterns as th

Re: [PATCH] btrfs: fix NULL pointer dereference from free_reloc_roots()

2017-09-06 Thread David Sterba
On Fri, Aug 25, 2017 at 08:49:11AM +0300, Nikolay Borisov wrote: > > > On 25.08.2017 08:15, Naohiro Aota wrote: > > __del_reloc_root should be called before freeing up reloc_root->node. > > If not, calling __del_reloc_root() dereference reloc_root->node, causing > > the system BUG. > > > > Signe

Re: [PATCH] btrfs: Remove redundant forward declarations

2017-09-06 Thread David Sterba
On Thu, Aug 31, 2017 at 11:48:51AM +0300, Nikolay Borisov wrote: > Some static functions are needlessly forward declared. Let's remove those > declarations since they add no value. > > Signed-off-by: Nikolay Borisov > --- > > Here is a less invasive version of my previous patch removing the fwd

Re: [PATCH] Btrfs: avoid wake_up if possible

2017-09-06 Thread David Sterba
On Fri, Sep 01, 2017 at 04:14:27PM -0600, Liu Bo wrote: > wake_up() will go to check whether someone is on the waiting list with > holding spin_lock(). > > Around some btrfs code, we don't check waitqueue_active() firstly, so > the spin_lock() pair in wake_up() is called even if no one is waiting >

Re: [PATCH] btrfs: declare TRACE_DEFINE_ENUM for each of show_flush_state enum

2017-09-06 Thread David Sterba
On Wed, Aug 30, 2017 at 10:36:48PM +0800, Anand Jain wrote: > So that perf can show the state symbol. > > Signed-off-by: Anand Jain Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majo

Re: [PATCH] Btrfs: protect conditions within root->log_mutex while waiting

2017-09-06 Thread David Sterba
On Fri, Sep 01, 2017 at 04:14:30PM -0600, Liu Bo wrote: > Both wait_for_commit() and wait_for_writer() are checking the > condition out of the mutex lock. > > This refactors code a bit to be lock safe. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe from this list: send t

Re: [PATCH] Btrfs: move finish_wait out of the loop

2017-09-06 Thread David Sterba
On Fri, Sep 01, 2017 at 04:14:28PM -0600, Liu Bo wrote: > If we're still going to wait after schedule(), we don't have to do > finish_wait() to remove our %wait_queue_entry since prepare_to_wait() > won't add the same %wait_queue_entry twice. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba

Re: [PATCH] Btrfs: use wait_event instead of a single function

2017-09-06 Thread David Sterba
On Fri, Sep 01, 2017 at 04:14:29PM -0600, Liu Bo wrote: > Since TASK_UNINTERRUPTIBLE has been used here, wait_event() can do the > same job. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to

Re: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior

2017-09-06 Thread Austin S. Hemmelgarn
On 2017-09-05 15:05, Goffredo Baroncelli wrote: On 09/05/2017 10:19 AM, Qu Wenruo wrote: On 2017年09月05日 02:08, David Sterba wrote: On Mon, Sep 04, 2017 at 03:41:05PM +0900, Qu Wenruo wrote: mkfs.btrfs --rootdir provides user a method to generate btrfs with pre-written content while without t