Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Duncan
Qu Wenruo posted on Tue, 29 Sep 2015 18:48:37 +0800 as excerpted: > Both gives quite good expression, I'll pick one of them. ... And for the one-line title, /bull/bad/ should do it. =:^) People wanting details about bad /how/ can look at the fuller description or source. -- Duncan - List repl

Re: lots of snapshots, forcing defragmentation, and figuring out which files to defrag or nodatacow

2015-09-29 Thread Duncan
James Cook posted on Mon, 28 Sep 2015 22:51:05 -0700 as excerpted: > The context of these three questions is that I'm experiencing occasional > hangs for several seconds while btrfs-transacti works, and very long > boot times. General comments welcome. System info at bottom, > end part of dmesg.lo

[PATCH] fstests: btrfs: Check if fallocate re-truncates page beyond EOF

2015-09-29 Thread Qu Wenruo
Even the fallocate range doesn't cover the last page of a file, btrfs will still re-truncate the last page. Such behavior is completely duplicated and unneeded, and fixed by the following kernel patch: btrfs: Avoid truncate tailing page if fallocate range doesn't exceed inode size Add this test

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
Dave Chinner wrote on 2015/09/30 14:20 +1000: On Wed, Sep 30, 2015 at 09:05:15AM +0800, Qu Wenruo wrote: Dave Chinner wrote on 2015/09/30 07:51 +1000: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not ad

[PATCH] Btrfs: fix simple_return.cocci warnings

2015-09-29 Thread kbuild test robot
fs/btrfs/free-space-tree.c:1255:1-4: WARNING: end returns can be simpified fs/btrfs/free-space-tree.c:1168:1-4: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocc

Re: [PATCH v4 6/9] Btrfs: implement the free space B-tree

2015-09-29 Thread kbuild test robot
Hi Omar, [auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore] coccinelle warnings: (new ones prefixed by >>) >> fs/btrfs/free-space-tree.c:1255:1-4: WARNING: end returns can be simpified fs/btrfs/free-space-tree.c:1168:1-4: WARNING: end returns can be simpified

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Dave Chinner
On Wed, Sep 30, 2015 at 09:05:15AM +0800, Qu Wenruo wrote: > > > Dave Chinner wrote on 2015/09/30 07:51 +1000: > >On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: > >>Normally, a bull fallocate call on a fully written and synced file > >>should not add an extent. > > > >Why not? Filesys

RE: [PATCH 2/2] btrfs: Fix lost-data-profile caused by balance bg

2015-09-29 Thread Zhao Lei
Hi, Filipe Manana Thanks for reviewing. > -Original Message- > From: Filipe Manana [mailto:fdman...@gmail.com] > Sent: Tuesday, September 29, 2015 11:48 PM > To: Zhao Lei > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH 2/2] btrfs: Fix lost-data-profile caused by balance bg > > O

RE: [PATCH] btrfs: fix a compiler warning of may be used uninitialized

2015-09-29 Thread Zhao Lei
Hi, David Sterba Thanks for reviewing. > -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Tuesday, September 29, 2015 10:22 PM > To: Zhao Lei > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs: fix a compiler warning of may be used > uninitialized >

[PATCH v4 2/2] btrfs-progs: check the free space tree in btrfsck

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval This reuses the existing code for checking the free space cache, we just need to load the free space tree. While we do that, we check a couple of invariants on the free space tree itself. This requires pulling in some code from the kernel to exclude the super stripes. Signed-

[PATCH v4 6/9] Btrfs: implement the free space B-tree

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval The free space cache has turned out to be a scalability bottleneck on large, busy filesystems. When the cache for a lot of block groups needs to be written out, we can get extremely long commit times; if this happens in the critical section, things are especially bad because w

[PATCH v4 3/9] Btrfs: add helpers for read-only compat bits

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval We're finally going to add one of these for the free space tree, so let's add the same nice helpers that we have for the incompat bits. While we're add it, also add helpers to clear the bits. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval --- fs/btrfs/ctree.h | 82 +

[PATCH v4 1/2] btrfs-progs: add basic awareness of the free space tree

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval To start, let's tell btrfs-progs to read the free space root and how to print the on-disk format of the free space tree. However, we're not adding the FREE_SPACE_TREE read-only compat bit to the set of supported bits because progs doesn't know how to keep the free space tree c

[PATCH v4 9/9] Btrfs: add free space tree mount option

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval Now we can finally hook up everything so we can actually use free space tree. The free space tree is enabled by passing the space_cache=v2 mount option. On the first mount with the this option set, the free space tree will be created and the FREE_SPACE_TREE read-only compat bi

[PATCH v4 1/9] Btrfs: add extent buffer bitmap operations

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval These are going to be used for the free space tree bitmap items. Signed-off-by: Omar Sandoval --- fs/btrfs/extent_io.c | 149 +++ fs/btrfs/extent_io.h | 6 +++ 2 files changed, 155 insertions(+) diff --git a/fs/btrfs/extent

[PATCH v4 5/9] Btrfs: introduce the free space B-tree on-disk format

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval The on-disk format for the free space tree is straightforward. Each block group is represented in the free space tree by a free space info item that stores accounting information: whether the free space for this block group is stored as bitmaps or extents and how many extents

[PATCH v4 7/9] Btrfs: add free space tree sanity tests

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval This tests the operations on the free space tree trying to excercise all of the main cases for both formats. Between this and xfstests, the free space tree should have pretty good coverage. Signed-off-by: Omar Sandoval --- fs/btrfs/Makefile | 3 +- fs

[PATCH v4 8/9] Btrfs: wire up the free space tree to the extent tree

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval The free space tree is updated in tandem with the extent tree. There are only a handful of places where we need to hook in: 1. Block group creation 2. Block group deletion 3. Delayed refs (extent creation and deletion) 4. Block group caching Signed-off-by: Omar Sandoval ---

[PATCH v4 4/9] Btrfs: refactor caching_thread()

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval We're also going to load the free space tree from caching_thread(), so we should refactor some of the common code. Signed-off-by: Omar Sandoval --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/extent-tree.c | 59 -- 2 files chang

[PATCH v4 0/9] Btrfs: free space B-tree

2015-09-29 Thread Omar Sandoval
Hi, Here's one more reroll of the free space B-tree patches, a more scalable alternative to the free space cache. Minimal changes this time around, I mainly wanted to resend this after Holger and I cleared up his bug report here: http://www.spinics.net/lists/linux-btrfs/msg47165.html. It initially

[PATCH v4 2/9] Btrfs: add extent buffer bitmap sanity tests

2015-09-29 Thread Omar Sandoval
From: Omar Sandoval Sanity test the extent buffer bitmap operations (test, set, and clear) against the equivalent standard kernel operations. Signed-off-by: Omar Sandoval --- fs/btrfs/extent_io.c | 34 ++ fs/btrfs/extent_io.h | 4 +- fs/btrfs/tests/extent-io-

RE: [PATCH v4 3/9] btrfs: add .copy_file_range file operation

2015-09-29 Thread Zhao Lei
Hi, Anna Schumaker > -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Anna Schumaker > Sent: Wednesday, September 30, 2015 2:05 AM > To: linux-...@vger.kernel.org; linux-btrfs@vger.kernel.org; > linux-fsde...@vger.kernel

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
Tsutomu Itoh wrote on 2015/09/30 10:45 +0900: On 2015/09/30 10:05, Qu Wenruo wrote: Dave Chinner wrote on 2015/09/30 07:51 +1000: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. Why not?

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Tsutomu Itoh
On 2015/09/30 10:05, Qu Wenruo wrote: Dave Chinner wrote on 2015/09/30 07:51 +1000: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. Why not? Filesystems can do whatever they want with exten

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
Dave Chinner wrote on 2015/09/30 07:51 +1000: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. Why not? Filesystems can do whatever they want with extents during a fallocate call. e.g. if t

btrfs send -c fails saying "parent determination failed"

2015-09-29 Thread Paride Legovini
96026 top level 5 uuid 49f34ca5-42da-7d4b-a159-c3027650d8e6 path rootfs-snapshot-20150929 Several other subvolumes also exist there, just in case it matters. On the receive side: # btrfs sub list -R /mnt/cryptobackup/ | grep rootfs-snapshot-20150923 ID 1532 gen 3066 top level 5 received_uuid adf43113

Re: [PATCH 00/23] btrfs device related patch set

2015-09-29 Thread Anand Jain
On 09/29/2015 10:34 PM, David Sterba wrote: On Fri, Aug 14, 2015 at 06:32:45PM +0800, Anand Jain wrote: Anand Jain (22): Btrfs: rename btrfs_sysfs_add_one to btrfs_sysfs_add_mounted Btrfs: rename btrfs_sysfs_remove_one to btrfs_sysfs_remove_mounted Btrfs: rename btrfs_kobj_add_device

[PATCH v2 2/2] btrfs-progs: device delete to accept devid

2015-09-29 Thread Anand Jain
This patch introduces new option for the command btrfs device delete [..] In a user reported issue on a 3-disk-RAID1, one disk failed with its SB unreadable. Now with this patch user will have a choice to delete the device using devid. The other method we could do, is to match the input dev

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Dave Chinner
On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: > Normally, a bull fallocate call on a fully written and synced file > should not add an extent. Why not? Filesystems can do whatever they want with extents during a fallocate call. e.g. if the blocks are shared, then fallocate might break

[no subject]

2015-09-29 Thread Paride Legovini
subscribe linux-btrfs -- 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 http://vger.kernel.org/majordomo-info.html

[no subject]

2015-09-29 Thread Paride Legovini
subscribe linux-btrfs -- 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 http://vger.kernel.org/majordomo-info.html

ftrace of kernel BUG at extent-tree.c during balance

2015-09-29 Thread Stéphane Lesimple
Hello, This bug has been discussed several times here already, both recently and also in 2012 where the bug was deemed fixed in btrfs-next, but probably wasn't in the end [1]. It has also been reported at a couple other places, such as [2]. I managed to add some trace_printk's at the beggini

[PATCH v4 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-29 Thread Anna Schumaker
From: Zach Brown Add a copy_file_range() system call for offloading copies between regular files. This gives an interface to underlying layers of the storage stack which can copy without reading and writing all the data. There are a few candidates that should support copy offloading in the near

[PATCH v4 3/9] btrfs: add .copy_file_range file operation

2015-09-29 Thread Anna Schumaker
From: Zach Brown This rearranges the existing COPY_RANGE ioctl implementation so that the .copy_file_range file operation can call the core loop that copies file data extent items. The extent copying loop is lifted up into its own function. It retains the core btrfs error checks that should be

[PATCH v4 0/9] VFS: In-kernel copy system call

2015-09-29 Thread Anna Schumaker
Copy system calls came up during Plumbers a while ago, mostly because several filesystems (including NFS and XFS) are currently working on copy acceleration implementations. We haven't heard from Zach Brown in a while, so I volunteered to push his patches upstream so individual filesystems don't n

[PATCH v4 4/9] vfs: Copy should check len after file open mode

2015-09-29 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index dd10750..

[PATCH v4 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-29 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darrick J. Wong

[PATCH v4 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-09-29 Thread Anna Schumaker
This is perfectly valid for BTRFS and XFS, so let's leave this up to filesystems to check. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba Reviewed-by: Darrick J. Wong --- fs/read_write.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index f3d

[PATCH v4 2/9] x86: add sys_copy_file_range to syscall tables

2015-09-29 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files changed

[PATCH v4 6/9] vfs: Copy should use file_out rather than file_in

2015-09-29 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6 +++--- 1 fi

[PATCH v4 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-09-29 Thread Anna Schumaker
This allows us to have an in-kernel copy mechanism that avoids frequent switches between kernel and user space. This is especially useful so NFSD can support server-side copies. I make pagecache copies configurable by adding three new (exclusive) flags: - COPY_FR_REFLINK tells vfs_copy_file_range

[PATCH v4 7/9] vfs: Remove copy_file_range mountpoint checks

2015-09-29 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba ---

[PATCH v4 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-29 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4311554..2e14b91 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrf

Re: btrfs fi defrag interfering (maybe) with Ceph OSD operation

2015-09-29 Thread Lionel Bouton
Le 29/09/2015 16:49, Lionel Bouton a écrit : > Le 27/09/2015 17:34, Lionel Bouton a écrit : >> [...] >> It's not clear to me that "btrfs fi defrag " can't interfere with >> another process trying to use the file. I assume basic reading and >> writing is OK but there might be restrictions on unlinki

[PATCH 10/11] btrfs-progs: use calloc instead of malloc+memset for volumes.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 09/11] btrfs-progs: use calloc instead of malloc+memset for quick-test.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 08/11] btrfs-progs: use calloc instead of malloc+memset for qgroup.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 11/11] btrfs-progs: check: fix memset range

2015-09-29 Thread Silvio Fricke
Signed-off-by: Silvio Fricke --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 2923d05..2c32ff3 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3021,7 +3021,7 @@ static struct root_backref *get_root_backref(struct root_record

[PATCH 07/11] btrfs-progs: use calloc instead of malloc+memset for mkfs.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 03/11] btrfs-progs: use calloc instead of malloc+memset for chunk-recover.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 05/11] btrfs-progs: use calloc instead of malloc+memset for disk-io.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 00/11] using of calloc instead of malloc+memset

2015-09-29 Thread Silvio Fricke
Hi btrfs, please review my patches about switching from malloc with memset to calloc. Thanks for that and eventual inclusion of my patches. Silvio Silvio Fricke (11): btrfs-progs: use calloc instead of malloc+memset for btrfs-image.c btrfs-progs: use calloc instead of malloc+memset for btrfs

[PATCH 06/11] btrfs-progs: use calloc instead of malloc+memset for extent_io.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 01/11] btrfs-progs: use calloc instead of malloc+memset for btrfs-image.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 02/11] btrfs-progs: use calloc instead of malloc+memset for btrfs-list.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

[PATCH 04/11] btrfs-progs: use calloc instead of malloc+memset for cmds-check.c

2015-09-29 Thread Silvio Fricke
This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Sig

Re: [PATCH] btrfs: remove unneeded NULL initializer for struct fs_path

2015-09-29 Thread Alexandru Moise
On Tue, Sep 29, 2015 at 02:32:29PM +0200, David Sterba wrote: > On Sat, Sep 26, 2015 at 12:05:19PM +, Alexandru Moise wrote: > > fs_path_alloc() either returns an alloc'ed struct fs_path > > or NULL, no need to initialize the pointer to NULL. > > > > Signed-off-by: Alexandru Moise <00moses.ale

Re: [PATCH] Btrfs: update fix for read corruption of compressed and shared extents

2015-09-29 Thread Timofey Titovets
On Sep 28, 2015 11:57, wrote: > > From: Filipe Manana > > My previous fix in commit 005efedf2c7d ("Btrfs: fix read corruption of > compressed and shared extents") was effective only if the compressed > extents cover a file range with a length that is not a multiple of 16 > pages. That's because t

Re: [PATCH 2/2] btrfs: Fix lost-data-profile caused by balance bg

2015-09-29 Thread Filipe Manana
On Tue, Sep 29, 2015 at 2:51 PM, Zhao Lei wrote: > Reproduce: > (In integration-4.3 branch) > > TEST_DEV=(/dev/vdg /dev/vdh) > TEST_DIR=/mnt/tmp > > umount "$TEST_DEV" >/dev/null > mkfs.btrfs -f -d raid1 "${TEST_DEV[@]}" > > mount -o nospace_cache "$TEST_DEV" "$TEST_DIR" > btrfs balance sta

Re: [PATCH 04/17] fs/btrfs: remove unnecessary new_valid_dev check

2015-09-29 Thread David Sterba
On Mon, Sep 28, 2015 at 09:39:00PM +0800, Yaowei Bai wrote: > As new_valid_dev always returns 1, so !new_valid_dev check is not > needed, remove it. > > Signed-off-by: Yaowei Bai Acked-by: David Sterba -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a me

Re: Btrfs duperemove corrupt data while dedup

2015-09-29 Thread Timofey Titovets
Thx Filipe, this is full fix my issue 2015-09-29 15:49 GMT+03:00 Filipe Manana : > On Tue, Sep 29, 2015 at 1:38 PM, Timofey Titovets > wrote: >> FYI: >> Looks like patch: >> Btrfs: fix read corruption of compressed and shared extents > > Try the second part (patch on top of that one) that fixes

Re: btrfs fi defrag interfering (maybe) with Ceph OSD operation

2015-09-29 Thread Lionel Bouton
Le 27/09/2015 17:34, Lionel Bouton a écrit : > [...] > It's not clear to me that "btrfs fi defrag " can't interfere with > another process trying to use the file. I assume basic reading and > writing is OK but there might be restrictions on unlinking/locking/using > other ioctls... Are there any I

Re: [PATCH 00/23] btrfs device related patch set

2015-09-29 Thread David Sterba
On Fri, Aug 14, 2015 at 06:32:45PM +0800, Anand Jain wrote: > Anand Jain (22): > Btrfs: rename btrfs_sysfs_add_one to btrfs_sysfs_add_mounted > Btrfs: rename btrfs_sysfs_remove_one to btrfs_sysfs_remove_mounted > Btrfs: rename btrfs_kobj_add_device to btrfs_sysfs_add_device_link > Btrfs: re

Re: [PATCH] btrfs: fix a compiler warning of may be used uninitialized

2015-09-29 Thread David Sterba
On Wed, Sep 02, 2015 at 03:19:59PM +0800, Zhao Lei wrote: > Not real problem, just avoid warning of: > fs/btrfs/inode-map.c: In function 'btrfs_unpin_free_ino': > fs/btrfs/inode-map.c:252: warning: 'count' may be used uninitialized in this > function > In gcc 4.8.3 > > Signed-off-by: Zhao Lei

Re: BTRFS as image store for KVM?

2015-09-29 Thread Gert Menke
Hi, thank you all for your helpful comments. From what I've read, I forged the following guidelines (for myself; ymmv): - Use btrfs for generic data storage on spinning disks and for everything on ssds. - Use zfs for spinning disks that may be used for cow-unfriendly workloads, like vm images

[PATCH 1/2] btrfs: Fix lost-data-profile caused by auto removing bg

2015-09-29 Thread Zhao Lei
Reproduce: (In integration-4.3 branch) TEST_DEV=(/dev/vdg /dev/vdh) TEST_DIR=/mnt/tmp umount "$TEST_DEV" >/dev/null mkfs.btrfs -f -d raid1 "${TEST_DEV[@]}" mount -o nospace_cache "$TEST_DEV" "$TEST_DIR" umount "$TEST_DEV" mount -o nospace_cache "$TEST_DEV" "$TEST_DIR" btrfs filesystem

[PATCH 2/2] btrfs: Fix lost-data-profile caused by balance bg

2015-09-29 Thread Zhao Lei
Reproduce: (In integration-4.3 branch) TEST_DEV=(/dev/vdg /dev/vdh) TEST_DIR=/mnt/tmp umount "$TEST_DEV" >/dev/null mkfs.btrfs -f -d raid1 "${TEST_DEV[@]}" mount -o nospace_cache "$TEST_DEV" "$TEST_DIR" btrfs balance start -dusage=0 $TEST_DIR btrfs filesystem usage $TEST_DIR dd if=/dev

Re: Btrfs duperemove corrupt data while dedup

2015-09-29 Thread Filipe Manana
On Tue, Sep 29, 2015 at 1:38 PM, Timofey Titovets wrote: > FYI: > Looks like patch: > Btrfs: fix read corruption of compressed and shared extents Try the second part (patch on top of that one) that fixes an additional corner case that I missed earlier: https://patchwork.kernel.org/patch/7275851/

Re: Btrfs duperemove corrupt data while dedup

2015-09-29 Thread Timofey Titovets
FYI: Looks like patch: Btrfs: fix read corruption of compressed and shared extents Partial fixed my issue 2015-08-26 22:33 GMT+03:00 Timofey Titovets : > Hello guys, > i like btrfs, and i want put it in production soon, > one of the feature that i want use, is a deduplication. > > i frequently te

Re: [PATCH] btrfs: remove unneeded NULL initializer for struct fs_path

2015-09-29 Thread David Sterba
On Sat, Sep 26, 2015 at 12:05:19PM +, Alexandru Moise wrote: > fs_path_alloc() either returns an alloc'ed struct fs_path > or NULL, no need to initialize the pointer to NULL. > > Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> > --- > fs/btrfs/send.c | 2 +- > 1 file changed, 1

Re: Excessive slab use deteriorates performance

2015-09-29 Thread David Sterba
On Sat, Sep 26, 2015 at 01:59:13PM +0200, Ferry Toth wrote: > Could there be any relation to btrfs causing the mentioned slabs to not be > automatically freeed? > > In the mean time we put: > vfs_cache_pressure = 1 > > And this seems to be keeping slabs total at 2.5GB (with btrfs_inode at

Re: Add stripes filter

2015-09-29 Thread Hugo Mills
On Tue, Sep 29, 2015 at 08:10:19AM -0400, Austin S Hemmelgarn wrote: > On 2015-09-29 08:00, David Sterba wrote: > >On Mon, Sep 28, 2015 at 05:57:05PM +, Gabríel Arthúr Pétursson wrote: > >>The attached patches to linux and btrfs-progs add support for filtering > >>based on the number of strips

Re: Add stripes filter

2015-09-29 Thread Austin S Hemmelgarn
On 2015-09-29 08:00, David Sterba wrote: On Mon, Sep 28, 2015 at 05:57:05PM +, Gabríel Arthúr Pétursson wrote: The attached patches to linux and btrfs-progs add support for filtering based on the number of strips in a block when balancing. What usecase do you want to address? As I understa

Re: Add stripes filter

2015-09-29 Thread David Sterba
On Mon, Sep 28, 2015 at 05:57:05PM +, Gabríel Arthúr Pétursson wrote: > The attached patches to linux and btrfs-progs add support for filtering > based on the number of strips in a block when balancing. What usecase do you want to address? As I understand it, this would help the raid56 rebalan

Re: mkfs.btrfs(8) --data outdated?

2015-09-29 Thread David Sterba
On Mon, Sep 28, 2015 at 09:22:25AM +0800, Qu Wenruo wrote: > We're planning to add support for -d dup on single disk case, and will > update man page at that time. Is dup for data possible? IIRC long time ago Chris mentioned that this does not work due to some offsets that would cause corruption.

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
在 2015年09月29日 18:24, Filipe Manana 写道: On Tue, Sep 29, 2015 at 11:13 AM, Qu Wenruo wrote: 在 2015年09月29日 18:00, Hugo Mills 写道: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. W

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
在 2015年09月29日 18:33, Eryu Guan 写道: On Tue, Sep 29, 2015 at 06:16:11PM +0800, Qu Wenruo wrote: + +if [ "x$orig_extent_nr" != "x$new_extent_nr" ]; then + echo "number of extents mis-match after bull fallocate" print out the $orig_extent_nr and $new_extent_nr in this failure case? I t

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Eryu Guan
On Tue, Sep 29, 2015 at 06:16:11PM +0800, Qu Wenruo wrote: > > >>+ > >>+if [ "x$orig_extent_nr" != "x$new_extent_nr" ]; then > >>+ echo "number of extents mis-match after bull fallocate" > > > >print out the $orig_extent_nr and $new_extent_nr in this failure case? I > >think it's useful to see t

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Hugo Mills
On Tue, Sep 29, 2015 at 06:13:37PM +0800, Qu Wenruo wrote: > > > 在 2015年09月29日 18:00, Hugo Mills 写道: > >On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: > >>Normally, a bull fallocate call on a fully written and synced file > >>should not add an extent. > > > >What's a "bull" falloc

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Filipe Manana
On Tue, Sep 29, 2015 at 11:13 AM, Qu Wenruo wrote: > > > 在 2015年09月29日 18:00, Hugo Mills 写道: >> >> On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: >>> >>> Normally, a bull fallocate call on a fully written and synced file >>> should not add an extent. >> >> >> What's a "bull" falloc

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
在 2015年09月29日 17:55, Eryu Guan 写道: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. But not all filesystem follows the correct behavior. Btrfs has a bug to always truncate the last page if

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
在 2015年09月29日 18:00, Hugo Mills 写道: On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: Normally, a bull fallocate call on a fully written and synced file should not add an extent. What's a "bull" fallocate call? Is it a typo, or simply something I'm not familiar with? Hugo.

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Hugo Mills
On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: > Normally, a bull fallocate call on a fully written and synced file > should not add an extent. What's a "bull" fallocate call? Is it a typo, or simply something I'm not familiar with? Hugo. > But not all filesystem follows the co

Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Eryu Guan
On Tue, Sep 29, 2015 at 05:34:24PM +0800, Qu Wenruo wrote: > Normally, a bull fallocate call on a fully written and synced file > should not add an extent. > > But not all filesystem follows the correct behavior. > > Btrfs has a bug to always truncate the last page if the fallocate start > offset

Re: [PATCH] fstests: test for btrfs incremental send after replacing a file

2015-09-29 Thread Filipe Manana
On Tue, Sep 29, 2015 at 10:48 AM, Eryu Guan wrote: > On Tue, Sep 29, 2015 at 09:33:34AM +0100, Filipe Manana wrote: >> On Tue, Sep 29, 2015 at 4:54 AM, Eryu Guan wrote: >> > On Sat, Sep 26, 2015 at 12:40:13PM +0100, fdman...@kernel.org wrote: >> >> From: Filipe Manana >> >> >> >> Test that an in

Re: [PATCH] fstests: test for btrfs incremental send after replacing a file

2015-09-29 Thread Eryu Guan
On Tue, Sep 29, 2015 at 09:33:34AM +0100, Filipe Manana wrote: > On Tue, Sep 29, 2015 at 4:54 AM, Eryu Guan wrote: > > On Sat, Sep 26, 2015 at 12:40:13PM +0100, fdman...@kernel.org wrote: > >> From: Filipe Manana > >> > >> Test that an incremental send works after a file from the parent snapshot

[PATCH v2] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
Normally, a bull fallocate call on a fully written and synced file should not add an extent. But not all filesystem follows the correct behavior. Btrfs has a bug to always truncate the last page if the fallocate start offset is smaller than inode size. So add this test case to detect such malfun

Re: [PATCH 0/4] Fix for btrfs-convert chunk type and fsck support

2015-09-29 Thread David Sterba
On Sat, Sep 26, 2015 at 03:56:42PM +0800, Qu Wenruo wrote: > > So can we do it like this: > > > > 1) enable support for mixed bg in convert > > 2) implement mixed -> split conversion in balance > > 3) force convert to do mixed bgs by default > > > > The conversion from/to mixed would be good on it'

[PATCH] fstests: generic: Check if a bull fallocate will change extent number

2015-09-29 Thread Qu Wenruo
Normally, a bull fallocate call on a fully written and synced file should not add a extent. But not all filesystem follows the correct behavior. Btrfs has a bug to always truncate the last page if the fallocate start offset is smaller than inode size. So add this test case to detect such malfunc

[PATCH] btrfs: Avoid truncate tailing page if fallocate range doesn't exceed inode size

2015-09-29 Thread Qu Wenruo
Current code will always truncate tailing page if its alloc_start is smaller than inode size. This behavior will cause a lot of unneeded COW page size extent. This patch will avoid such problem. Signed-off-by: Qu Wenruo --- fs/btrfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH] fstests: test for btrfs incremental send after replacing a file

2015-09-29 Thread Filipe Manana
On Tue, Sep 29, 2015 at 4:54 AM, Eryu Guan wrote: > On Sat, Sep 26, 2015 at 12:40:13PM +0100, fdman...@kernel.org wrote: >> From: Filipe Manana >> >> Test that an incremental send works after a file from the parent snapshot >> gets replaced in the send snapshot by another one at the same exact >>