Re: [PATCH 0/7] fs_info cleanups for volume.c

2018-07-20 Thread Lu Fengqi
On Fri, Jul 20, 2018 at 07:37:46PM +0300, Nikolay Borisov wrote: >Here are a bunch of patches which cleanup extraneous fs_info parameters to >function which already take a structure that holds a reference to the fs_info. > >Except for patches 4 and 5, everything else is correct - due to those

Re: btrfs filesystem corruptions with 4.18. git kernels

2018-07-20 Thread Qu Wenruo
On 2018年07月21日 05:28, Alexander Wetzel wrote: > Hello, > > I'm running my normal workstation with git kernels from > git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-testing.git > and just got the second file system corruption in three weeks. I do not > have issues with stable

Re: btrfs filesystem corruptions with 4.18. git kernels

2018-07-20 Thread Hugo Mills
On Fri, Jul 20, 2018 at 11:28:42PM +0200, Alexander Wetzel wrote: > Hello, > > I'm running my normal workstation with git kernels from > git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-testing.git > and just got the second file system corruption in three weeks. I do > not have

Re: btrfs filesystem corruptions with 4.18. git kernels

2018-07-20 Thread Christian Kujau
On Fri, 20 Jul 2018, Alexander Wetzel wrote: > [ 979.223808] BTRFS: error (device sdc2) in __btrfs_cow_block:1080: errno=-5 > IO failure Are there no other messages in syslog? "IO failure" (from fs/btrfs/super.c:75) sounds like a problem with the underlying device. Maybe try w/o the "discard"

btrfs filesystem corruptions with 4.18. git kernels

2018-07-20 Thread Alexander Wetzel
Hello, I'm running my normal workstation with git kernels from git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-testing.git and just got the second file system corruption in three weeks. I do not have issues with stable kernels, and just want to give you a heads up that there

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Austin S. Hemmelgarn
On 2018-07-20 14:41, Hugo Mills wrote: On Fri, Jul 20, 2018 at 09:38:14PM +0300, Andrei Borzenkov wrote: 20.07.2018 20:16, Goffredo Baroncelli пишет: [snip] Limiting the number of disk per raid, in BTRFS would be quite simple to implement in the "chunk allocator" You mean that currently

[PATCH] Btrfs: fix btrfs_write_inode() vs delayed iput deadlock

2018-07-20 Thread Omar Sandoval
From: Josef Bacik We recently ran into the following deadlock involving btrfs_write_inode(): [ +0.005066] __schedule+0x38e/0x8c0 [ +0.007144] schedule+0x36/0x80 [ +0.006447] bit_wait+0x11/0x60 [ +0.006446] __wait_on_bit+0xbe/0x110 [ +0.007487] ? bit_wait_io+0x60/0x60 [ +0.007319]

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Hugo Mills
On Fri, Jul 20, 2018 at 09:38:14PM +0300, Andrei Borzenkov wrote: > 20.07.2018 20:16, Goffredo Baroncelli пишет: [snip] > > Limiting the number of disk per raid, in BTRFS would be quite simple to > > implement in the "chunk allocator" > > > > You mean that currently RAID5 stripe size is equal

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Andrei Borzenkov
20.07.2018 20:16, Goffredo Baroncelli пишет: > On 07/20/2018 07:17 AM, Andrei Borzenkov wrote: >> 18.07.2018 22:42, Goffredo Baroncelli пишет: >>> On 07/18/2018 09:20 AM, Duncan wrote: Goffredo Baroncelli posted on Wed, 18 Jul 2018 07:59:52 +0200 as excerpted: > On 07/17/2018

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Austin S. Hemmelgarn
On 2018-07-20 13:13, Goffredo Baroncelli wrote: On 07/19/2018 09:10 PM, Austin S. Hemmelgarn wrote: On 2018-07-19 13:29, Goffredo Baroncelli wrote: [...] So until now you are repeating what I told: the only useful raid profile are - striping - mirroring - striping+paring (even limiting the

Re: [PATCH 1/2] btrfs: kill btrfs_write_inode

2018-07-20 Thread Omar Sandoval
On Fri, Jul 20, 2018 at 01:48:01PM +0200, David Sterba wrote: > On Thu, May 31, 2018 at 11:49:28AM +0200, David Sterba wrote: > > On Tue, May 29, 2018 at 12:17:42PM -0700, Omar Sandoval wrote: > > > On Mon, May 28, 2018 at 06:57:59PM +0200, David Sterba wrote: > > > > On Tue, May 22, 2018 at

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Goffredo Baroncelli
On 07/20/2018 07:17 AM, Andrei Borzenkov wrote: > 18.07.2018 22:42, Goffredo Baroncelli пишет: >> On 07/18/2018 09:20 AM, Duncan wrote: >>> Goffredo Baroncelli posted on Wed, 18 Jul 2018 07:59:52 +0200 as >>> excerpted: >>> On 07/17/2018 11:12 PM, Duncan wrote: > Goffredo Baroncelli

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread Goffredo Baroncelli
On 07/19/2018 09:10 PM, Austin S. Hemmelgarn wrote: > On 2018-07-19 13:29, Goffredo Baroncelli wrote: [...] >> >> So until now you are repeating what I told: the only useful raid profile are >> - striping >> - mirroring >> - striping+paring (even limiting the number of disk involved) >> -

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread David Sterba
On Thu, Jul 19, 2018 at 07:47:23AM -0400, Austin S. Hemmelgarn wrote: > > So this special level will be used for RAID56 for now? > > Or it will also be possible for metadata usage just like current RAID1? > > > > If the latter, the metadata scrub problem will need to be considered more. > > > >

[PATCH 6/7] btrfs: Remove fs_info form btrfs_free_chunk

2018-07-20 Thread Nikolay Borisov
It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov --- fs/btrfs/volumes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 241875277a7e..7376c83708e4 100644 --- a/fs/btrfs/volumes.c +++

[PATCH 1/7] btrfs: Remove fs_info argument from btrfs_add_dev_item

2018-07-20 Thread Nikolay Borisov
It can be referenced form the passed transaction handle. Signed-off-by: Nikolay Borisov --- fs/btrfs/volumes.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e8fb9d5d976e..e73b9e9d6c10 100644 --- a/fs/btrfs/volumes.c

[PATCH 4/7] btrfs: Remove fs_info from btrfs_assign_next_active_device

2018-07-20 Thread Nikolay Borisov
It can be referenced from the passed 'device' argument which is always a well-formed device. Signed-off-by: Nikolay Borisov --- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/volumes.c | 9 + fs/btrfs/volumes.h | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git

[PATCH 2/7] btrfs: Remove fs_info from btrfs_rm_dev_replace_remove_srcdev

2018-07-20 Thread Nikolay Borisov
It can be referenced from the passed srcdev argument. Signed-off-by: Nikolay Borisov --- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/volumes.c | 5 ++--- fs/btrfs/volumes.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/dev-replace.c

[PATCH 7/7] btrfs: Remove fs_info from btrfs_finish_chunk_alloc

2018-07-20 Thread Nikolay Borisov
It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov --- fs/btrfs/extent-tree.c | 5 ++--- fs/btrfs/volumes.c | 10 +- fs/btrfs/volumes.h | 6 ++ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/extent-tree.c

[PATCH 3/7] btrfs: remove fs_info argument from update_dev_stat_item

2018-07-20 Thread Nikolay Borisov
It can be referenced from the passed transaction handle. Signed-off-by: Nikolay Borisov --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 844e5d4fd3e4..35cc5b6a06e0 100644 --- a/fs/btrfs/volumes.c +++

[PATCH 0/7] fs_info cleanups for volume.c

2018-07-20 Thread Nikolay Borisov
Here are a bunch of patches which cleanup extraneous fs_info parameters to function which already take a structure that holds a reference to the fs_info. Except for patches 4 and 5, everything else is correct - due to those functions always taking a transaction. 4 and 5 in turn reference the

[PATCH 5/7] btrfs: Remove fs_info from btrfs_destroy_dev_replace_tgtdev

2018-07-20 Thread Nikolay Borisov
This function is always passed a well-formed tgtdevice so the fs_info can be referenced from there. Signed-off-by: Nikolay Borisov --- fs/btrfs/dev-replace.c | 6 +++--- fs/btrfs/volumes.c | 5 ++--- fs/btrfs/volumes.h | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff

Re: [PATCH 0/4] 3- and 4- copy RAID1

2018-07-20 Thread David Sterba
On Thu, Jul 19, 2018 at 03:27:17PM +0800, Qu Wenruo wrote: > On 2018年07月14日 02:46, David Sterba wrote: > > Hi, > > > > I have some goodies that go into the RAID56 problem, although not > > implementing all the remaining features, it can be useful independently. > > > > This time my hackweek

Re: [PATCH 01/22] btrfs: add btrfs_delete_ref_head helper

2018-07-20 Thread David Sterba
fstests run in the sequence from btrfs/001, in qemu, 2G memory, warning and crash at btrfs/124 btrfs/124 [22:58:39] [10100.765898] run fstests btrfs/124 at 2018-07-19 22:58:39 ... [10110.113787] BTRFS: device fsid 8b6b700e-3346-4260-bb2e-c561ba4b9960 devid 1 transid 7 /dev/vdb

Re: [PATCH 3/7] btrfs: remove redundant member async_cow::root

2018-07-20 Thread David Sterba
On Thu, Jul 19, 2018 at 01:05:14PM +0200, David Sterba wrote: > The root is only used to get fs_info out of it, but the same can be > retrieved from the inode that's in async_cow. > > Signed-off-by: David Sterba > --- > fs/btrfs/inode.c | 7 +-- > 1 file changed, 1 insertion(+), 6

Re: [PATCH 01/22] btrfs: add btrfs_delete_ref_head helper

2018-07-20 Thread David Sterba
On Thu, Jul 19, 2018 at 10:49:45AM -0400, Josef Bacik wrote: > --- a/fs/btrfs/extent-tree.c > +++ b/fs/btrfs/extent-tree.c > @@ -2577,12 +2577,9 @@ static int cleanup_ref_head(struct btrfs_trans_handle > *trans, > spin_unlock(_refs->lock); > return 1; > } > -

[PATCH 4/4] btrfs: merge free_fs_root helpers

2018-07-20 Thread David Sterba
The exported helper just calls the static one. There's no obvious reason to have them separate eg. for performance reasons where the static one could be better optimized in the same unit. There's a slight decrease in code size and stack consumption. Signed-off-by: David Sterba ---

[PATCH 0/4] More structure shrinking and cleanups

2018-07-20 Thread David Sterba
A few more structure member leftovers spotted, and some trivial cleanups. David Sterba (4): btrfs: remove unused member btrfs_root::name btrfs: dev-replace: remove unused members of btrfs_dev_replace btrfs: constify strings passed to assertion helper btrfs: merge free_fs_root helpers

[PATCH 1/4] btrfs: remove unused member btrfs_root::name

2018-07-20 Thread David Sterba
Added in 58176a9604c ("Btrfs: Add per-root block accounting and sysfs entries") in 2007, the roots had names exported in sysfs. The code was commented out in 4df27c4d5cc1dda54ed ("Btrfs: change how subvolumes are organized") and cleaned by 182608c8294b5fe9 ("btrfs: remove old unused commented out

[PATCH 2/4] btrfs: dev-replace: remove unused members of btrfs_dev_replace

2018-07-20 Thread David Sterba
Lock owner and nesting level have been unused since day 1, probably copy from the extent_buffer locking scheme without much thinking. The locking of device replace is simpler and does not need any lock nesting. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 2 -- fs/btrfs/disk-io.c | 2 --

[PATCH 3/4] btrfs: constify strings passed to assertion helper

2018-07-20 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 5f6ec80d374f..2e32584c635f 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3425,7 +3425,7 @@ do {

Re: [PATCH 01/22] btrfs: add btrfs_delete_ref_head helper

2018-07-20 Thread Josef Bacik
On Fri, Jul 20, 2018 at 04:11:29PM +0300, Nikolay Borisov wrote: > > > On 19.07.2018 17:49, Josef Bacik wrote: > > From: Josef Bacik > > > > We do this dance in cleanup_ref_head and check_ref_cleanup, unify it > > into a helper and cleanup the calling functions. > > > > Signed-off-by: Josef

Re: [PATCH 01/22] btrfs: add btrfs_delete_ref_head helper

2018-07-20 Thread Nikolay Borisov
On 19.07.2018 17:49, Josef Bacik wrote: > From: Josef Bacik > > We do this dance in cleanup_ref_head and check_ref_cleanup, unify it > into a helper and cleanup the calling functions. > > Signed-off-by: Josef Bacik > --- > fs/btrfs/delayed-ref.c | 14 ++ >

Re: [PATCH v2] btrfs: fix bug of chunk type check

2018-07-20 Thread Qu Wenruo
On 2018年07月20日 18:17, Gu Jinxiang wrote: > chunk type BTRFS_BLOCK_GROUP_METADATA and BTRFS_BLOCK_GROUP_DATA > should not be set in a non-mixed chunk at the same time. > > Since BTRFS_BLOCK_GROUP_METADATA is 0x4 and BTRFS_BLOCK_GROUP_DATA is 0x1, > BTRFS_BLOCK_GROUP_METADATA &

Re: [PATCH 08/22] btrfs: dump block_rsv whe dumping space info

2018-07-20 Thread David Sterba
On Thu, Jul 19, 2018 at 10:49:52AM -0400, Josef Bacik wrote: > For enospc_debug having the block rsvs is super helpful to see if we've > done something wrong. > > Signed-off-by: Josef Bacik > --- > fs/btrfs/extent-tree.c | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git

Re: [PATCH 1/2] btrfs: kill btrfs_write_inode

2018-07-20 Thread David Sterba
On Thu, May 31, 2018 at 11:49:28AM +0200, David Sterba wrote: > On Tue, May 29, 2018 at 12:17:42PM -0700, Omar Sandoval wrote: > > On Mon, May 28, 2018 at 06:57:59PM +0200, David Sterba wrote: > > > On Tue, May 22, 2018 at 01:47:22PM -0400, Josef Bacik wrote: > > > > From: Josef Bacik > > > > >

Re: Healthy amount of free space?

2018-07-20 Thread Austin S. Hemmelgarn
On 2018-07-20 01:01, Andrei Borzenkov wrote: 18.07.2018 16:30, Austin S. Hemmelgarn пишет: On 2018-07-18 09:07, Chris Murphy wrote: On Wed, Jul 18, 2018 at 6:35 AM, Austin S. Hemmelgarn wrote: If you're doing a training presentation, it may be worth mentioning that preallocation with

Re: [PATCH 7/7] btrfs: add helper function check device delete able

2018-07-20 Thread Anand Jain
On 07/20/2018 09:34 AM, Anand Jain wrote: On 07/19/2018 07:45 PM, David Sterba wrote: On Mon, Jul 16, 2018 at 10:58:12PM +0800, Anand Jain wrote: Move the section of the code which performs the check if the device is indelible, move that into a helper function. Signed-off-by: Anand Jain

Re: [PATCH 6/7] btrfs: add helper btrfs_num_devices() to deduce num_devices

2018-07-20 Thread Anand Jain
On 07/19/2018 07:53 PM, David Sterba wrote: On Mon, Jul 16, 2018 at 10:58:11PM +0800, Anand Jain wrote: When the replace is running the fs_devices::num_devices also includes the replace device, however in some operations like device delete and balance it needs the actual num_devices without

Re: [PATCH] btrfs: fix bug of chunk type check

2018-07-20 Thread David Sterba
On Fri, Jul 20, 2018 at 01:17:38PM +0800, Gu Jinxiang wrote: > chunk type BTRFS_BLOCK_GROUP_METADATA and BTRFS_BLOCK_GROUP_DATA > should not be set in a non-mixed chunk at the same time. > > Since BTRFS_BLOCK_GROUP_METADATA is 0x4 and BTRFS_BLOCK_GROUP_DATA is 0x1, > BTRFS_BLOCK_GROUP_METADATA &

[PATCH v2] btrfs: fix bug of chunk type check

2018-07-20 Thread Gu Jinxiang
chunk type BTRFS_BLOCK_GROUP_METADATA and BTRFS_BLOCK_GROUP_DATA should not be set in a non-mixed chunk at the same time. Since BTRFS_BLOCK_GROUP_METADATA is 0x4 and BTRFS_BLOCK_GROUP_DATA is 0x1, BTRFS_BLOCK_GROUP_METADATA & BTRFS_BLOCK_GROUP_DATA will be 0x0, so we should judge type is one of

[PATCH v2] Btrfs: fix mount failure after fsync due to hard link recreation

2018-07-20 Thread fdmanana
From: Filipe Manana If we end up with logging an inode reference item which has the same name but different index from the one we have persisted, we end up failing when replaying the log with an errno value of -EEXIST. The error comes from btrfs_add_link(), which is called from add_inode_ref(),

Re: [PATCH 22/22] btrfs: only run delayed refs if we're committing

2018-07-20 Thread Nikolay Borisov
On 19.07.2018 17:50, Josef Bacik wrote: > I noticed in a giant dbench run that we spent a lot of time on lock > contention while running transaction commit. This is because dbench > results in a lot of fsync()'s that do a btrfs_transaction_commit(), and > they all run the delayed refs first

Re: [PATCH 3/7] btrfs: do device clone using the btrfs_scan_one_device

2018-07-20 Thread Anand Jain
On 07/20/2018 02:35 PM, Anand Jain wrote: On 07/19/2018 08:31 PM, David Sterba wrote: On Mon, Jul 16, 2018 at 10:58:08PM +0800, Anand Jain wrote: When we add a device to the RO mounted seed device, it becomes a RW sprout FS. The following steps are used to hold the seed and sprout

Re: [bug report] btrfs: add helper function check device delete able

2018-07-20 Thread Anand Jain
Noted. Thanks Dan. -Anand On 07/19/2018 04:10 PM, Dan Carpenter wrote: Hello Anand Jain, The patch a6500c9ef8ac: "btrfs: add helper function check device delete able" from Jul 10, 2018, leads to the following static checker warning: fs/btrfs/volumes.c:1871

Re: [PATCH 3/7] btrfs: do device clone using the btrfs_scan_one_device

2018-07-20 Thread Anand Jain
On 07/19/2018 08:31 PM, David Sterba wrote: On Mon, Jul 16, 2018 at 10:58:08PM +0800, Anand Jain wrote: When we add a device to the RO mounted seed device, it becomes a RW sprout FS. The following steps are used to hold the seed and sprout fs_devices. (first two steps are not mandatory for

Re: [PATCH] btrfs: fix bug of chunk type check

2018-07-20 Thread Qu Wenruo
On 2018年07月20日 14:14, Nikolay Borisov wrote: > > > On 20.07.2018 08:17, Gu Jinxiang wrote: >> chunk type BTRFS_BLOCK_GROUP_METADATA and BTRFS_BLOCK_GROUP_DATA >> should not be set in a non-mixed chunk at the same time. >> >> Since BTRFS_BLOCK_GROUP_METADATA is 0x4 and BTRFS_BLOCK_GROUP_DATA

Re: [PATCH] btrfs: fix bug of chunk type check

2018-07-20 Thread Nikolay Borisov
On 20.07.2018 08:17, Gu Jinxiang wrote: > chunk type BTRFS_BLOCK_GROUP_METADATA and BTRFS_BLOCK_GROUP_DATA > should not be set in a non-mixed chunk at the same time. > > Since BTRFS_BLOCK_GROUP_METADATA is 0x4 and BTRFS_BLOCK_GROUP_DATA is 0x1, > BTRFS_BLOCK_GROUP_METADATA &