Re: [PATCH] Btrfs: fill ->last_trans for delayed inode in btrfs_fill_inode.

2015-04-08 Thread Miao Xie
> runtime_flags if needed in this situation. Then we can get the > log entries we expected after (6) and generic/311 passed. > > Signed-off-by: Dongsheng Yang Good catch! Reviewed-by: Miao Xie > --- > fs/btrfs/delayed-inode.c | 2 ++ > fs/btrfs/inode.c | 21 ++

Re: [PATCH RFC v6 6/9] vfs: Add sb_want_write() function to get vfsmount from a given sb.

2015-02-04 Thread Miao Xie
cess since there is | > another mount instance) | > | umount /mnt2 (fail since there > | is sb_want_write() waiting) > > So Alice can't thaw the fs since there is no mount point for it now. >

Re: [PATCH v5 0/9] btrfs: Fix freeze/sysfs deadlock in better method.

2015-01-30 Thread Miao Xie
On Fri, 30 Jan 2015 20:17:49 +0100, David Sterba wrote: > On Fri, Jan 30, 2015 at 05:20:45PM +0800, Qu Wenruo wrote: >> [Use VFS protect for sysfs change] >> The 6th patch will introduce a new help function sb_want_write() to >> claim write permission to a superblock. >> With this, we are able to d

Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 04:37:14 +, Al Viro wrote: > On Fri, Jan 30, 2015 at 12:14:24PM +0800, Miao Xie wrote: >> On Fri, 30 Jan 2015 02:14:45 +, Al Viro wrote: >>> On Fri, Jan 30, 2015 at 09:44:03AM +0800, Qu Wenruo wrote: >>> >>>> This shouldn't h

Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 02:14:45 +, Al Viro wrote: > On Fri, Jan 30, 2015 at 09:44:03AM +0800, Qu Wenruo wrote: > >> This shouldn't happen. If someone is ro, the whole fs should be ro, right? > > Wrong. Individual vfsmounts over an r/w superblock might very well be r/o. > As for that trylock...

Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 10:02:26 +0800, Qu Wenruo wrote: > > Original Message > Subject: Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get > vfsmount from a given sb. > From: Qu Wenruo > To: Miao Xie , linux-btrfs@vger.kernel.org > Da

Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 10:51:52 +0800, Qu Wenruo wrote: > > Original Message > Subject: Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse > mount > option in a atomic way > From: Miao Xie > To: Qu Wenruo , > Date: 2015年01月30日 10:06 >>

Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 09:33:17 +0800, Qu Wenruo wrote: > > Original Message > Subject: Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse > mount > option in a atomic way > From: Miao Xie > To: Qu Wenruo , > Date: 2015年01月30日 09:29 >>

Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way

2015-01-29 Thread Miao Xie
On Fri, 30 Jan 2015 09:20:46 +0800, Qu Wenruo wrote: >> Here need ACCESS_ONCE to wrap info->mount_opt, or the complier might use >> info->mount_opt instead of new_opt. > Thanks for pointing out this one. >> >> But I worried that this is not key reason of the wrong space cache. Could >> you explain

Re: [PATCH RESEND v4 6/8] vfs: Add get_vfsmount_sb() function to get vfsmount from a given sb.

2015-01-29 Thread Miao Xie
On Thu, 29 Jan 2015 10:24:39 +0800, Qu Wenruo wrote: > There are sysfs interfaces in some fs, only btrfs yet, which will modify > on-disk data. > Unlike normal file operation routine we can use mnt_want_write_file() to > protect the operation, change through sysfs won't to be binded to any file > i

Re: [PATCH RESEND v4 2/8] btrfs: Make btrfs_parse_options() parse mount option in a atomic way

2015-01-29 Thread Miao Xie
On Thu, 29 Jan 2015 10:24:35 +0800, Qu Wenruo wrote: > Current btrfs_parse_options() is not atomic, which can set and clear a > bit, especially for nospace_cache case. > > For example, if a fs is mounted with nospace_cache, > btrfs_parse_options() will set SPACE_CACHE bit first(since > cache_gener

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-25 Thread Miao Xie
On Fri, 23 Jan 2015 17:59:49 +0100, David Sterba wrote: > On Wed, Jan 21, 2015 at 03:04:02PM +0800, Miao Xie wrote: >>> Pending changes are *not* only mount options. Feature change and label >>> change >>> are also pending changes if using sysfs. >> >>

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-21 Thread Miao Xie
On Wed, 21 Jan 2015 15:47:54 +0800, Qu Wenruo wrote: >> On Wed, 21 Jan 2015 11:53:34 +0800, Qu Wenruo wrote: > [snipped] > This will cause another problem, nobody can ensure there will be next > transaction and the change may > never to written into disk. First, the pending cha

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-20 Thread Miao Xie
On Wed, 21 Jan 2015 11:53:34 +0800, Qu Wenruo wrote: >> +/* >> + * Test if the fs is frozen, or start_trasaction >> + * will deadlock on itself. >> + */ >> +if (__sb_start_write(sb, SB_FREEZE_FS, fal

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-20 Thread Miao Xie
On Wed, 21 Jan 2015 11:15:41 +0800, Qu Wenruo wrote: > > Original Message > Subject: Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs > to > avoid deadlock. > From: Miao Xie > To: Chris Mason , Qu Wenruo > Date: 2015年01月21日 11

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-20 Thread Miao Xie
On Tue, 20 Jan 2015 20:10:56 -0500, Chris Mason wrote: > On Tue, Jan 20, 2015 at 8:09 PM, Qu Wenruo wrote: >> >> Original Message >> Subject: Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs >> to avoid deadlock. >> From: Chris Mason >> To: Qu Wenruo >> Date

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-20 Thread Miao Xie
On Tue, 20 Jan 2015 11:17:07 +0800, Qu Wenruo wrote: >> --- a/fs/btrfs/super.c >> +++ b/fs/btrfs/super.c >> @@ -1000,6 +1000,14 @@ int btrfs_sync_fs(struct super_block *sb, int >> wait) >> */ >>if (fs_info->pending_changes == 0) >>

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-19 Thread Miao Xie
On Tue, 20 Jan 2015 10:53:05 +0800, Qu Wenruo wrote: > Add CC to Miao Xie > > Original Message > Subject: Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs > to > avoid deadlock. > From: Qu Wenruo > To: dste...@suse.cz, linux-bt

Re: [PATCH] btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.

2015-01-19 Thread Miao Xie
On Mon, 19 Jan 2015 15:42:41 +0800, Qu Wenruo wrote: > Commit 6b5fe46dfa52 (btrfs: do commit in sync_fs if there are pending > changes) will call btrfs_start_transaction() in sync_fs(), to handle > some operations needed to be done in next transaction. > > However this can cause deadlock if the fi

Re: [PATCH] Btrfs: fix typo of variable in scrub_stripe

2015-01-09 Thread Miao Xie
; - btrfs_free_path(ppath); > + btrfs_free_path(path); My bad. Thanks to fix it. Reviewed-by: Miao Xie > return -ENOMEM; > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of

Re: [PATCH] btrfs: fix raid56 scrub failed in xfstests btrfs/072

2015-01-08 Thread Miao Xie
t; > To fix it, we just add the @search_commit_root flag back. Reviewed-by: Miao Xie > > Signed-off-by: Gui Hecheng > Signed-off-by: Qu Wenruo > --- > fs/btrfs/scrub.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c

Re: [PATCH] btrfs: delete chunk allocation attemp when setting block group ro

2015-01-08 Thread Miao Xie
On Thu, 08 Jan 2015 18:06:50 -0800, Shaohua Li wrote: > On Fri, Jan 09, 2015 at 09:01:57AM +0800, Miao Xie wrote: >> On Thu, 08 Jan 2015 13:23:13 -0800, Shaohua Li wrote: >>> Below test will fail currently: >>> mkfs.ext4 -F /dev/sda >>> btrfs-conver

Re: [PATCH] btrfs: delete chunk allocation attemp when setting block group ro

2015-01-08 Thread Miao Xie
On Thu, 08 Jan 2015 13:23:13 -0800, Shaohua Li wrote: > Below test will fail currently: > mkfs.ext4 -F /dev/sda > btrfs-convert /dev/sda > mount /dev/sda /mnt > btrfs device add -f /dev/sdb /mnt > btrfs balance start -v -dconvert=raid1 -mconvert=raid1 /mnt > > The reason is there are som

Re: [PATCH v4 00/10] Implement device scrub/replace for RAID56

2014-12-02 Thread Miao Xie
On Tue, 2 Dec 2014 08:28:22 -0500, Chris Mason wrote: > On Tue, Dec 2, 2014 at 7:39 AM, Miao Xie wrote: >> This patchset implement the device scrub/replace function for RAID56, the >> most implementation of the common data is similar to the other RAID type. >> The differentia

Re: [PATCH v4 00/10] Implement device scrub/replace for RAID56

2014-12-02 Thread Miao Xie
On Tue, 2 Dec 2014 08:28:22 -0500, Chris Mason wrote: > > > On Tue, Dec 2, 2014 at 7:39 AM, Miao Xie wrote: >> This patchset implement the device scrub/replace function for RAID56, the >> most implementation of the common data is similar to the other RAID type. >> Th

Re: [PATCH v3 10/11] Btrfs: fix possible deadlock caused by pending I/O in plug list

2014-12-02 Thread Miao Xie
hi, Chris On Fri, 28 Nov 2014 16:32:03 -0500, Chris Mason wrote: > On Wed, Nov 26, 2014 at 10:00 PM, Miao Xie wrote: >> On Thu, 27 Nov 2014 09:39:56 +0800, Miao Xie wrote: >>> On Wed, 26 Nov 2014 10:02:23 -0500, Chris Mason wrote: >>>> On Wed, Nov 26, 20

[PATCH v4 05/10] Btrfs, raid56: use a variant to record the operation type

2014-12-02 Thread Miao Xie
variant to record the operation type. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None. --- fs/btrfs/raid56.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index c954537..4924388 100644 --- a

[PATCH v4 09/10] Btrfs, raid56: fix use-after-free problem in the final device replace procedure on raid56

2014-12-02 Thread Miao Xie
raid56 io ends. Signed-off-by: Miao Xie --- Changelog v3 -> v4: - None. Changelog v2 -> v3: - New patch to fix undealt use-after-free problem of the source device in the final device replace procedure. Changelog v1 -> v2: - None. --- fs/btrfs/ctree.h | 7 ++- fs/btrfs

[PATCH v4 02/10] Btrfs: remove unnecessary code of stripe_index assignment in __btrfs_map_block

2014-12-02 Thread Miao Xie
From: Zhao Lei stripe_index's value was set again in latter line: stripe_index = 0; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie Reviewed-by: David Sterba --- Changelog v1 -> v4: - None. --- fs/btrfs/volumes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --

[PATCH v4 07/10] Btrfs, replace: write dirty pages into the replace target device

2014-12-02 Thread Miao Xie
this time, we will find the relative replace target stripes and wirte the relative data into it. Note: The function that copying old data on the source device to the target device was implemented in the past, it is similar to the other RAID type. Signed-off-by: Miao Xie --- Changelog v1 -> v4

[PATCH v4 10/10] Btrfs, replace: enable dev-replace for raid56

2014-12-02 Thread Miao Xie
From: Zhao Lei Signed-off-by: Zhao Lei Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None. --- fs/btrfs/dev-replace.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 326919b..51133ea 100644 --- a/fs/btrfs/dev-replace.c +++ b

[PATCH v4 04/10] Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted

2014-12-02 Thread Miao Xie
This patch implement the RAID5/6 common data repair function, the implementation is similar to the scrub on the other RAID such as RAID1, the differentia is that we don't read the data from the mirror, we use the data repair function of RAID5/6. Signed-off-by: Miao Xie --- Changelog v3

[PATCH v4 06/10] Btrfs, raid56: support parity scrub on raid56

2014-12-02 Thread Miao Xie
o data, we introduce a bitmap. If there is some data on the horizontal sub-stripe, we will the relative bit to 1, and when we check and repair the parity, we will skip those horizontal sub-stripes that the relative bits is 0. Signed-off-by: Miao Xie --- Changelog v3 -> v4: - None. Changelog v2

[PATCH v4 08/10] Btrfs, replace: write raid56 parity into the replace target device

2014-12-02 Thread Miao Xie
This function reused the code of parity scrub, and we just write the right parity or corrected parity into the target device before the parity scrub end. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None. --- fs/btrfs/raid56.c | 23 +++ fs/btrfs/scrub.c | 2 +-

[PATCH v4 01/10] Btrfs: remove noused bbio_ret in __btrfs_map_block in condition

2014-12-02 Thread Miao Xie
From: Zhao Lei bbio_ret in this condition is always !NULL because previous code already have a check-and-skip: 4908 if (!bbio_ret) 4909 goto out; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie Reviewed-by: David Sterba --- Changelog v1 -> v4: - None. --- fs/btrfs/volumes.c | 3 +--

[PATCH v4 00/10] Implement device scrub/replace for RAID56

2014-12-02 Thread Miao Xie
sed to avoid the rbio merge. Changelog v1 -> v2: - Change some function names in raid56.c to make them fit the code style of the raid56. Thanks Miao Miao Xie (7): Btrfs, raid56: don't change bbio and raid_map Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted Btrf

[PATCH v4 03/10] Btrfs, raid56: don't change bbio and raid_map

2014-12-02 Thread Miao Xie
Because we will reuse bbio and raid_map during the scrub later, it is better that we don't change any variant of bbio and don't free it at the end of IO request. So we introduced similar variants into the raid bio, and don't access those bbio's variants any more. Sig

Re: [PATCH] Btrfs: fix wrong list access on the failure of reading out checksum

2014-12-01 Thread Miao Xie
Please ignore this patch, Chris has fixed this problem. Thanks Miao On Mon, 1 Dec 2014 18:04:13 +0800, Miao Xie wrote: > If we failed to reading out the checksum, we would free all the checksums > in the list. But the current code accessed the list head, not the entry > in the lis

[PATCH] Btrfs: fix wrong list access on the failure of reading out checksum

2014-12-01 Thread Miao Xie
If we failed to reading out the checksum, we would free all the checksums in the list. But the current code accessed the list head, not the entry in the list. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/file-item.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs

Re: [PATCH v3 10/11] Btrfs: fix possible deadlock caused by pending I/O in plug list

2014-11-26 Thread Miao Xie
On Thu, 27 Nov 2014 09:39:56 +0800, Miao Xie wrote: > On Wed, 26 Nov 2014 10:02:23 -0500, Chris Mason wrote: >> On Wed, Nov 26, 2014 at 8:04 AM, Miao Xie wrote: >>> The increase/decrease of bio counter is on the I/O path, so we should >>> use io_schedule() instead of

Re: [PATCH v3 10/11] Btrfs: fix possible deadlock caused by pending I/O in plug list

2014-11-26 Thread Miao Xie
On Wed, 26 Nov 2014 10:02:23 -0500, Chris Mason wrote: > On Wed, Nov 26, 2014 at 8:04 AM, Miao Xie wrote: >> The increase/decrease of bio counter is on the I/O path, so we should >> use io_schedule() instead of schedule(), or the deadlock might be >> triggered by the pending

[PATCH v3 10/11] Btrfs: fix possible deadlock caused by pending I/O in plug list

2014-11-26 Thread Miao Xie
-by: Miao Xie --- Changelog v2 -> v3: - New patch to fix possible deadlock caused by the pending bios in the plug list when the io submitters were going to sleep. Changelog v1 -> v2: - None. --- fs/btrfs/dev-replace.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-)

[PATCH v3 07/11] Btrfs, replace: write dirty pages into the replace target device

2014-11-26 Thread Miao Xie
this time, we will find the relative replace target stripes and wirte the relative data into it. Note: The function that copying old data on the source device to the target device was implemented in the past, it is similar to the other RAID type. Signed-off-by: Miao Xie --- Changelog v1 -> v3

[PATCH v3 09/11] Btrfs, raid56: fix use-after-free problem in the final device replace procedure on raid56

2014-11-26 Thread Miao Xie
raid56 io ends. Signed-off-by: Miao Xie --- Changelog v2 -> v3: - New patch to fix undealt use-after-free problem of the source device in the final device replace procedure. Changelog v1 -> v2: - None. --- fs/btrfs/ctree.h | 7 ++- fs/btrfs/dev-replace.c | 4 ++-- fs/btrfs/ra

[PATCH v3 11/11] Btrfs, replace: enable dev-replace for raid56

2014-11-26 Thread Miao Xie
From: Zhao Lei Signed-off-by: Zhao Lei Signed-off-by: Miao Xie --- Changelog v1 -> v3: - None. --- fs/btrfs/dev-replace.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 894796a..9f6a464 100644 --- a/fs/btrfs/dev-replace.c +++ b

[PATCH v3 06/11] Btrfs, raid56: support parity scrub on raid56

2014-11-26 Thread Miao Xie
o data, we introduce a bitmap. If there is some data on the horizontal sub-stripe, we will the relative bit to 1, and when we check and repair the parity, we will skip those horizontal sub-stripes that the relative bits is 0. Signed-off-by: Miao Xie --- Changelog v2 -> v3: - Fix wrong stripe

[PATCH v3 02/11] Btrfs: remove unnecessary code of stripe_index assignment in __btrfs_map_block

2014-11-26 Thread Miao Xie
From: Zhao Lei stripe_index's value was set again in latter line: stripe_index = 0; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie Reviewed-by: David Sterba --- Changelog v1 -> v3: - None. --- fs/btrfs/volumes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --

[PATCH v3 03/11] Btrfs, raid56: don't change bbio and raid_map

2014-11-26 Thread Miao Xie
Because we will reuse bbio and raid_map during the scrub later, it is better that we don't change any variant of bbio and don't free it at the end of IO request. So we introduced similar variants into the raid bio, and don't access those bbio's variants any more. Sig

[PATCH v3 04/11] Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted

2014-11-26 Thread Miao Xie
This patch implement the RAID5/6 common data repair function, the implementation is similar to the scrub on the other RAID such as RAID1, the differentia is that we don't read the data from the mirror, we use the data repair function of RAID5/6. Signed-off-by: Miao Xie --- Changelog v1

[PATCH v3 08/11] Btrfs, replace: write raid56 parity into the replace target device

2014-11-26 Thread Miao Xie
This function reused the code of parity scrub, and we just write the right parity or corrected parity into the target device before the parity scrub end. Signed-off-by: Miao Xie --- Changelog v1 -> v3: - None. --- fs/btrfs/raid56.c | 23 +++ fs/btrfs/scrub.c | 2 +-

[PATCH v3 01/11] Btrfs: remove noused bbio_ret in __btrfs_map_block in condition

2014-11-26 Thread Miao Xie
From: Zhao Lei bbio_ret in this condition is always !NULL because previous code already have a check-and-skip: 4908 if (!bbio_ret) 4909 goto out; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie Reviewed-by: David Sterba --- Changelog v1 -> v3: - None. --- fs/btrfs/volumes.c | 3 +--

[PATCH v3 00/11] Implement device scrub/replace for RAID56

2014-11-26 Thread Miao Xie
ode that is used to avoid the rbio merge. Changelog v1 -> v2: - Change some function names in raid56.c to make them fit the code style of the raid56. Thanks Miao Miao Xie (8): Btrfs, raid56: don't change bbio and raid_map Btrfs, scrub: repair the common data on RAID5/6 if it i

[PATCH v3 05/11] Btrfs, raid56: use a variant to record the operation type

2014-11-26 Thread Miao Xie
variant to record the operation type. Signed-off-by: Miao Xie --- Changelog v1 -> v3: - None. --- fs/btrfs/raid56.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 6013d88..bfc406d 100644 --- a

[PATCH v2 4/9] Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted

2014-11-24 Thread Miao Xie
This patch implement the RAID5/6 common data repair function, the implementation is similar to the scrub on the other RAID such as RAID1, the differentia is that we don't read the data from the mirror, we use the data repair function of RAID5/6. Signed-off-by: Miao Xie --- Changelog v1

Re: [PATCH] Btrfs: make sure we wait on logged extents when fsycning two subvols

2014-11-20 Thread Miao Xie
On Thu, 6 Nov 2014 10:19:54 -0500, Josef Bacik wrote: > If we have two fsync()'s race on different subvols one will do all of its work > to get into the log_tree, wait on it's outstanding IO, and then allow the > log_tree to finish it's commit. The problem is we were just free'ing that > subvols l

[PATCH 2/9] Btrfs: remove unnecessary code of stripe_index assignment in __btrfs_map_block

2014-11-14 Thread Miao Xie
From: Zhao Lei stripe_index's value was set again in latter line: stripe_index = 0; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie --- fs/btrfs/volumes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 41b0dff..66

[PATCH 8/9] Btrfs, replace: write raid56 parity into the replace target device

2014-11-14 Thread Miao Xie
This function reused the code of parity scrub, and we just write the right parity or corrected parity into the target device before the parity scrub end. Signed-off-by: Miao Xie --- fs/btrfs/raid56.c | 23 +++ fs/btrfs/scrub.c | 2 +- 2 files changed, 24 insertions(+), 1

[PATCH 7/9] Btrfs, replace: write dirty pages into the replace target device

2014-11-14 Thread Miao Xie
this time, we will find the relative replace target stripes and wirte the relative data into it. Note: The function that copying old data on the source device to the target device was implemented in the past, it is similar to the other RAID type. Signed-off-by: Miao Xie --- fs/btrfs/raid56.c

[PATCH 3/9] Btrfs, raid56: don't change bbio and raid_map

2014-11-14 Thread Miao Xie
Because we will reuse bbio and raid_map during the scrub later, it is better that we don't change any variant of bbio and don't free it at the end of IO request. So we introduced similar variants into the raid bio, and don't access those bbio's variants any more. Signed-off-b

[PATCH 4/9] Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted

2014-11-14 Thread Miao Xie
This patch implement the RAID5/6 common data repair function, the implementation is similar to the scrub on the other RAID such as RAID1, the differentia is that we don't read the data from the mirror, we use the data repair function of RAID5/6. Signed-off-by: Miao Xie --- fs/btrfs/rai

[PATCH 5/9] Btrfs,raid56: use a variant to record the operation type

2014-11-14 Thread Miao Xie
variant to record the operation type. Signed-off-by: Miao Xie --- fs/btrfs/raid56.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index b3e9c76..d550e9b 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56

[PATCH 1/9] Btrfs: remove noused bbio_ret in __btrfs_map_block in condition

2014-11-14 Thread Miao Xie
From: Zhao Lei bbio_ret in this condition is always !NULL because previous code already have a check-and-skip: 4908 if (!bbio_ret) 4909 goto out; Signed-off-by: Zhao Lei Signed-off-by: Miao Xie --- fs/btrfs/volumes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a

[PATCH 9/9] Btrfs, replace: enable dev-replace for raid56

2014-11-14 Thread Miao Xie
From: Zhao Lei Signed-off-by: Zhao Lei Signed-off-by: Miao Xie --- fs/btrfs/dev-replace.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 6f662b3..6aa835c 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -316,11

[PATCH 6/9] Btrfs,raid56: support parity scrub on raid56

2014-11-14 Thread Miao Xie
o data, we introduce a bitmap. If there is some data on the horizontal sub-stripe, we will the relative bit to 1, and when we check and repair the parity, we will skip those horizontal sub-stripes that the relative bits is 0. Signed-off-by: Miao Xie --- fs/btrfs/raid

[PATCH 0/9] Implement device scrub/replace for RAID56

2014-11-14 Thread Miao Xie
interesting to use it or test it, you can pull the patchset from https://github.com/miaoxie/linux-btrfs.git raid56-scrub-replace Thanks Miao Miao Xie (6): Btrfs, raid56: don't change bbio and raid_map Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted Btrfs,raid56: use a va

Re: [PATCH] Btrfs: fix incorrect compression ratio detection

2014-11-09 Thread Miao Xie
ite) > > Fix this problem by checking every time before compression, if it is a > small write(<=blocksize), we bail out and fall into nocompression directly. > > Signed-off-by: Wang Shilong Looks good. Reviewed-by: Miao Xie > --- > fs/btrfs/inode.c | 16 ++

Re: [PATCH] Btrfs: don't do async reclaim during log replay V2

2014-11-06 Thread Miao Xie
On Thu, 6 Nov 2014 09:39:19 -0500, Josef Bacik wrote: > On 10/23/2014 04:44 AM, Miao Xie wrote: >> On Thu, 18 Sep 2014 11:27:17 -0400, Josef Bacik wrote: >>> Trying to reproduce a log enospc bug I hit a panic in the async reclaim code >>> during log replay. This is beca

Re: [PATCH] Btrfs: don't take the chunk_mutex/dev_list mutex in statfs V2

2014-11-04 Thread Miao Xie
On Mon, 3 Nov 2014 08:56:50 -0500, Josef Bacik wrote: > Our gluster boxes get several thousand statfs() calls per second, which begins > to suck hardcore with all of the lock contention on the chunk mutex and dev > list > mutex. We don't really need to hold these things, if we have transient > we

Re: [PATCH v3] Btrfs: fix snapshot inconsistency after a file write followed by truncate

2014-10-29 Thread Miao Xie
On Wed, 29 Oct 2014 08:21:12 +, Filipe Manana wrote: > If right after starting the snapshot creation ioctl we perform a write > against a > file followed by a truncate, with both operations increasing the file's size, > we > can get a snapshot tree that reflects a state of the source subvolum

Re: [PATCH] Btrfs: don't do async reclaim during log replay V2

2014-10-29 Thread Miao Xie
Ping.. On Thu, 23 Oct 2014 16:44:54 +0800, Miao Xie wrote: > On Thu, 18 Sep 2014 11:27:17 -0400, Josef Bacik wrote: >> Trying to reproduce a log enospc bug I hit a panic in the async reclaim code >> during log replay. This is because we use fs_info->fs_root as our root for >

Re: [PATCH] Btrfs: fix race that makes btrfs_lookup_extent_info miss skinny extent items

2014-10-27 Thread Miao Xie
On Mon, 27 Oct 2014 13:44:22 +, Filipe David Manana wrote: > On Mon, Oct 27, 2014 at 12:11 PM, Filipe David Manana > wrote: >> On Mon, Oct 27, 2014 at 11:08 AM, Miao Xie wrote: >>> On Mon, 27 Oct 2014 09:19:52 +, Filipe Manana wrote: >>>> We have a rac

Re: [PATCH] Btrfs: fix race that makes btrfs_lookup_extent_info miss skinny extent items

2014-10-27 Thread Miao Xie
On Mon, 27 Oct 2014 09:19:52 +, Filipe Manana wrote: > We have a race that can lead us to miss skinny extent items in the function > btrfs_lookup_extent_info() when the skinny metadata feature is enabled. > So basically the sequence of steps is: > > 1) We search in the extent tree for the skin

Re: [PATCH] Btrfs: fix invalid leaf slot access in btrfs_lookup_extent()

2014-10-27 Thread Miao Xie
On Mon, 27 Oct 2014 09:16:55 +, Filipe Manana wrote: > If we couldn't find our extent item, we accessed the current slot > (path->slots[0]) to check if it corresponds to an equivalent skinny > metadata item. However this slot could be beyond our last item in the > leaf (i.e. path->slots[0] >= b

Re: device balance times

2014-10-23 Thread Miao Xie
On Wed, 22 Oct 2014 14:40:47 +0200, Piotr Pawłow wrote: > On 22.10.2014 03:43, Chris Murphy wrote: >> On Oct 21, 2014, at 4:14 PM, Piotr Pawłow wrote: >>> Looks normal to me. Last time I started a balance after adding 6th device >>> to my FS, it took 4 days to move 25GBs of data. >> It's long ter

Re: [PATCH] Btrfs: don't do async reclaim during log replay V2

2014-10-23 Thread Miao Xie
On Thu, 18 Sep 2014 11:27:17 -0400, Josef Bacik wrote: > Trying to reproduce a log enospc bug I hit a panic in the async reclaim code > during log replay. This is because we use fs_info->fs_root as our root for > shrinking and such. Technically we can use whatever root we want, but let's > just n

Re: [PATCH] Btrfs: properly clean up btrfs_end_io_wq_cache

2014-10-23 Thread Miao Xie
sef Bacik Reviewed-by: Miao Xie > --- > fs/btrfs/super.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > index b83ef15..c1d020f 100644 > --- a/fs/btrfs/super.c > +++ b/fs/btrfs/super.c > @@ -2151,6 +2151,7 @@ static void

Re: [PATCH 2/2] Btrfs: check-int: don't complain about balanced blocks

2014-10-17 Thread Miao Xie
On Thu, 16 Oct 2014 17:48:49 +0200, Stefan Behrens wrote: > The xfstest btrfs/014 which tests the balance operation caused that the > check_int module complained that known blocks changed their physical > location. Since this is not an error in this case, only print such > message if the verbose mo

Re: [PATCH] Btrfs: return failure if btrfs_dev_replace_finishing() failed

2014-10-12 Thread Miao Xie
Guan On Sat, 11 Oct 2014 14:45:29 +0800, Eryu Guan wrote: device replace could fail due to another running scrub process, but this failure doesn't get returned to userspace. The following steps could reproduce this issue mkfs -t btrfs -f /dev/sdb1 /dev/sdb2

Re: [PATCH] Btrfs: return failure if btrfs_dev_replace_finishing() failed

2014-10-10 Thread Miao Xie
On Fri, 10 Oct 2014 15:13:31 +0800, Eryu Guan wrote: > On Thu, Sep 25, 2014 at 06:28:14PM +0800, Eryu Guan wrote: >> device replace could fail due to another running scrub process, but this >> failure doesn't get returned to userspace. >> >> The following steps could reproduce this issue >> >>

Re: [PATCH 2/2 v5] Btrfs: be aware of btree inode write errors to avoid fs corruption

2014-09-24 Thread Miao Xie
On Wed, 24 Sep 2014 11:28:26 +0100, Filipe Manana wrote: [SNIP] > int btrfs_wait_marked_extents(struct btrfs_root *root, > + struct btrfs_trans_handle *trans, > struct extent_io_tree *dirty_pages, int mark) > { > int err = 0; > @@ -852,6

Re: [PATCH] btrfs: Fix the wrong condition judgment about subset extent map

2014-09-21 Thread Miao Xie
This patch and the previous one(The following patch) also fixed a oops, which can be reproduced by LTP stress test(ltpstress.sh + fsstress). [PATCH] btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map Thanks Miao On Mon, 22 Sep 2014 09:13:03 +0800, Qu Wenruo wrote: >

Re: [PATCH] btrfs: fix ABBA deadlock in btrfs_dev_replace_finishing()

2014-09-21 Thread Miao Xie
It has been fixed by https://patchwork.kernel.org/patch/4747961/ Thanks Miao On Sun, 21 Sep 2014 12:41:49 +0800, Eryu Guan wrote: > btrfs_map_bio() first calls btrfs_bio_counter_inc_blocked() which checks > fs state and increase bio_counter, then calls __btrfs_map_block() which > will take the d

Re: kernel integration branch updated

2014-09-18 Thread Miao Xie
Chris On Fri, 19 Sep 2014 09:45:17 +0800, Qu Wenruo wrote: > Hi Chris, > > > I'm sorry that the commit 'btrfs: Fix and enhance merge_extent_mapping() to > insert best fitted extent map' > has a V2 patch, so the one in tree is not up-to-data. > > Although the v2 change is quite small and it's r

[PATCH v4 09/11] Btrfs: Set real mirror number for read operation on RAID0/5/6

2014-09-12 Thread Miao Xie
We need real mirror number for RAID0/5/6 when reading data, or if read error happens, we would pass 0 as the number of the mirror on which the io error happens. It is wrong and would cause the filesystem read the data from the corrupted mirror again. Signed-off-by: Miao Xie --- Changelog v1

[PATCH v4 01/11] Btrfs: load checksum data once when submitting a direct read io

2014-09-12 Thread Miao Xie
improves this problem by loading the data at once. Signed-off-by: Miao Xie --- Changelog v3 -> v4: - None Changelog v2 -> v3: - Fix the wrong return value of btrfs_bio_clone Changelog v1 -> v2: - Remove the __GFP_ZERO flag in btrfs_submit_direct because it would trigger a WARNi

[PATCH v4 08/11] Btrfs: modify clean_io_failure and make it suit direct io

2014-09-12 Thread Miao Xie
d-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/extent_io.c | 31 +++ fs/btrfs/extent_io.h | 6 +++--- fs/btrfs/scrub.c | 3 +-- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index

[PATCH v4 11/11] Btrfs: cleanup the read failure record after write or when the inode is freeing

2014-09-12 Thread Miao Xie
o the failure records will be left in the tree, we need free them when we free the inode or the memory leak happens. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/extent_io.c | 34 ++ fs/btrfs/extent_io.h | 1 + fs/btrfs/inode.c | 6 ++

[PATCH v4 06/11] Btrfs: split bio_readpage_error into several functions

2014-09-12 Thread Miao Xie
The data repair function of direct read will be implemented later, and some code in bio_readpage_error will be reused, so split bio_readpage_error into several functions which will be used in direct read repair later. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/bt

[PATCH v4 02/11] Btrfs: cleanup similar code of the buffered data data check and dio read data check

2014-09-12 Thread Miao Xie
Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/inode.c | 102 +-- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index af304e1..e8139c6 100644 --- a/fs/btrfs/inod

[PATCH v4 10/11] Btrfs: implement repair function when direct read fails

2014-09-12 Thread Miao Xie
the new mirror is still corrupted, we will try next mirror until we read right data or all the mirrors are traversed. - After the above work, we set the uptodate flag according to the result. Signed-off-by: Miao Xie --- Changelog v3 -> v4: - Use a dedicated btrfs workqueue instead of the sys

[PATCH v4 03/11] Btrfs: do file data check by sub-bio's self

2014-09-12 Thread Miao Xie
f the direct io data repair implementation. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/btrfs_inode.h | 9 + fs/btrfs/extent_io.c | 2 +- fs/btrfs/inode.c | 100 - fs/btrfs/volumes.h | 5 ++- 4 files

[PATCH v4 05/11] Btrfs: Cleanup unused variant and argument of IO failure handlers

2014-09-12 Thread Miao Xie
Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/extent_io.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index f8dda46..154cb8e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/bt

[PATCH v4 04/11] Btrfs: fix missing error handler if submiting re-read bio fails

2014-09-12 Thread Miao Xie
We forgot to free failure record and bio after submitting re-read bio failed, fix it. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/extent_io.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 92a6d9f..f8dd

[PATCH v4 00/11] Implement the data repair function for direct read

2014-09-12 Thread Miao Xie
> v2: - Fix the warning which was triggered by __GFP_ZERO in the 2nd patch Miao Xie (11): Btrfs: load checksum data once when submitting a direct read io Btrfs: cleanup similar code of the buffered data data check and dio read data check Btrfs: do file data check by sub-bio'

[PATCH v4 07/11] Btrfs: modify repair_io_failure and make it suit direct io

2014-09-12 Thread Miao Xie
structure. In order to implement direct read data repair, we need modify repair_io_failure and pass all filesystem data it need by function parameters. Signed-off-by: Miao Xie --- Changelog v1 -> v4: - None --- fs/btrfs/extent_io.c | 8 +--- fs/btrfs/extent_io.h | 2 +- fs/btrfs/scrub.c

Re: [PATCH 5/5] Btrfs: scan all the devices and build the fs device list by btrfs's self

2014-09-08 Thread Miao Xie
On Sat, 6 Sep 2014 13:48:09 +0200, Goffredo Baroncelli wrote: > On 09/03/2014 03:36 PM, Miao Xie wrote: >> The original code need scan the devices and build the fs device list by the >> user >> tool by udev or users' selves. It is flexible. But if someone re-install the

[PATCH 18/18] Btrfs: modify rw_devices counter under chunk_mutex context

2014-09-03 Thread Miao Xie
rw_devices counter is often used to tune the profile when doing chunk allocation, so we should modify it under the chunk_mutex context to avoid getting wrong chunk profile. Signed-off-by: Miao Xie --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs

[PATCH 13/18] Btrfs: fix unprotected device list access when cloning fs devices

2014-09-03 Thread Miao Xie
which was being changed when we clone the fs devices. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/volumes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 357f911..f0173b1 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -583,6

[PATCH 1/5] block: export disk_class and disk_type for btrfs

2014-09-03 Thread Miao Xie
mount the filesystem. So I want btrfs scan the system and find all the devices by itself in the kernel. In order to implement it, we need disk_class and disk_type, so export them. Signed-off-by: Miao Xie --- block/genhd.c | 7 +-- include/linux/genhd.h | 1 + 2 files changed, 6

[PATCH 15/18] Btrfs: make the logic of source device removing more clear

2014-09-03 Thread Miao Xie
Signed-off-by: Miao Xie --- fs/btrfs/dev-replace.c | 3 +-- fs/btrfs/volumes.c | 19 +++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index e9cbbdb..6f662b3 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs

  1   2   3   4   5   6   7   8   9   10   >