Re: RAID 6 corrupted

2017-05-17 Thread Roman Mamedov
On Thu, 18 May 2017 04:09:38 +0200 Łukasz Wróblewski wrote: > I will try when stable 4.12 comes out. > Unfortunately I do not have a backup. > Fortunately, these data are not so critical. > Some private photos and videos of youth. > However, I would be very happy if I could get it

[PATCH 16/32] btrfs-progs: Refactor nodesize user in print-tree.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- print-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print-tree.c b/print-tree.c index a0d33956..1b15640b 100644 --- a/print-tree.c +++ b/print-tree.c @@ -1297,7 +1297,7 @@ void btrfs_print_tree(struct btrfs_root

[PATCH 01/32] btrfs-progs: Remove deprecated leafsize usage

2017-05-17 Thread Qu Wenruo
Leafsize is deprecated for a long time, and kernel has already updated ctree.h to rename sb->leafsize to sb->__unused_leafsize. This patch will remove normal users of leafsize: 1) Remove leafsize member from btrfs_root structure Now only root->nodesize and root->sectorisze. No longer

[PATCH 12/32] btrfs-progs: Refactor block sizes users in cmds-check.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-check.c | 110 +++ 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index ad7c81b2..ce479855 100644 --- a/cmds-check.c +++ b/cmds-check.c

[PATCH 03/32] btrfs-progs: Refactor block sizes users in disk-io.c

2017-05-17 Thread Qu Wenruo
Since we have cached block sizes in fs_info, there is no need to specify these sizes in btrfs_setup_root() function. And refactor all root->sector/node/stripesize users in disk-io.c. Signed-off-by: Qu Wenruo --- chunk-recover.c | 11 ++ disk-io.c | 64

[PATCH 13/32] btrfs-progs: Refactor nodesize user in btrfstune.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfstune.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfstune.c b/btrfstune.c index 257bac44..0a6ad9ca 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -149,7 +149,7 @@ static int change_extents_uuid(struct

[PATCH 00/32] btrfs_fs_info refactoring

2017-05-17 Thread Qu Wenruo
The patchset can be fetched from my github: https://github.com/adam900710/btrfs-progs/tree/fs_info_refactor Which is based on v4.11-rc1. This quite scary patchset does a large refactoring (while still less than 500 LoC) to move sector/node/stripe size members from btrfs_root to btrfs_fs_info.

[PATCH 05/32] btrfs-progs: Refactor block sizes users in ctree.c and ctree.h

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- ctree.c | 10 +- ctree.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ctree.c b/ctree.c index 02c71807..266a3cf2 100644 --- a/ctree.c +++ b/ctree.c @@ -650,7 +650,7 @@ struct extent_buffer

[PATCH 10/32] btrfs-progs: Refactor nodesize user in extent_io.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extent_io.c b/extent_io.c index 915c6ed8..26a67865 100644 --- a/extent_io.c +++ b/extent_io.c @@ -765,7 +765,7 @@ int write_data_to_disk(struct btrfs_fs_info

[PATCH 08/32] btrfs-progs: Refactor block sizes users in backref.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- backref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backref.c b/backref.c index e1f41e1a..31681a85 100644 --- a/backref.c +++ b/backref.c @@ -451,7 +451,7 @@ static int __add_missing_keys(struct btrfs_fs_info

[PATCH 30/32] btrfs-progs: Refactor btrfs_root paramters in btrfs-corrupt-block.c

2017-05-17 Thread Qu Wenruo
Refactor the following functions and its callers to get rid of incorrectly passed btrfs_root parameters: 1) corrupt_keys() 2) corrupt_metadata_block() The only reason passing btrfs_root for them is to get block sizes. Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c

[PATCH 19/32] btrfs-progs: Refactor sectorsize users in mkfs/main.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- mkfs/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs/main.c b/mkfs/main.c index 61f746b3..24a51cb4 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -451,7 +451,7 @@ static int fill_inode_item(struct

[PATCH 17/32] btrfs-progs: Refactor nodesize users in qgroup-verify.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- qgroup-verify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qgroup-verify.c b/qgroup-verify.c index 23d34699..2f4b1c66 100644 --- a/qgroup-verify.c +++ b/qgroup-verify.c @@ -736,7 +736,7 @@ static int

[PATCH 26/32] btrfs-progs: Refactor sectorsize users in convert/main.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- convert/main.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/convert/main.c b/convert/main.c index c56382e9..bf050132 100644 --- a/convert/main.c +++ b/convert/main.c @@ -159,7 +159,7 @@ static int

[PATCH 20/32] btrfs-progs: Refactor sectorsizes users in file-item.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- file-item.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/file-item.c b/file-item.c index 333fa339..6877a1a9 100644 --- a/file-item.c +++ b/file-item.c @@ -162,7 +162,8 @@ btrfs_lookup_csum(struct

[PATCH 23/32] btrfs-progs: Refactor sectorsize users in volumes.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- volumes.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/volumes.c b/volumes.c index b350e259..3fc5a624 100644 --- a/volumes.c +++ b/volumes.c @@ -1060,9 +1060,9 @@ again:

[PATCH 18/32] btrfs-progs: Refactor nodesize users in cmds-inspect-tree-stats.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-inspect-tree-stats.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cmds-inspect-tree-stats.c b/cmds-inspect-tree-stats.c index 58dd29e1..ecb33ce2 100644 --- a/cmds-inspect-tree-stats.c +++

[PATCH 11/32] btrfs-progs: Refactor nodesize users in image/main.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- image/main.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/image/main.c b/image/main.c index f1c28de1..6a4ccfaf 100644 --- a/image/main.c +++ b/image/main.c @@ -919,7 +919,7 @@ static int

[PATCH 14/32] btrfs-progs: Refactor nodesize users in utils.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.c b/utils.c index d2489e70..823b7f3d 100644 --- a/utils.c +++ b/utils.c @@ -378,7 +378,7 @@ int btrfs_make_root_dir(struct btrfs_trans_handle *trans,

[PATCH 25/32] btrfs-progs: Refactor sectorsize in convert/source-fs.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- convert/source-fs.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/convert/source-fs.c b/convert/source-fs.c index 80e4e418..59e36095 100644 --- a/convert/source-fs.c +++ b/convert/source-fs.c @@ -68,9

[PATCH 09/32] btrfs-progs: Refactor block sizes users in cmds-restore.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-restore.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c index c327cef0..09388b29 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -126,7 +126,7 @@ static int

[PATCH 24/32] btrfs-progs: Refactor sectorsize users in free-space-tree.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- free-space-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/free-space-tree.c b/free-space-tree.c index f3a51263..69a4eca8 100644 --- a/free-space-tree.c +++ b/free-space-tree.c @@ -205,7 +205,7 @@ static int

[PATCH 32/32] btrfs-progs: Refactor read_node_slot function to get rid of btrfs_root parameter

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-restore.c | 5 +++-- ctree.c| 37 ++--- ctree.h| 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/cmds-restore.c b/cmds-restore.c index ae01430c..06c88b26 100644 ---

[PATCH 27/32] btrfs-progs: Refactor sectorsize users in convert/source-ext2.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- convert/source-ext2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert/source-ext2.c b/convert/source-ext2.c index 1b0576b1..d12681b5 100644 --- a/convert/source-ext2.c +++ b/convert/source-ext2.c @@ -289,7 +289,7

[PATCH 28/32] btrfs-progs: Refactor sectorsize users in cmds-inspect-dump-tree.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-inspect-dump-tree.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c index 5a5ca536..869ad6ba 100644 --- a/cmds-inspect-dump-tree.c +++

[PATCH 29/32] btrfs-progs: Remove block size members in btrfs_root

2017-05-17 Thread Qu Wenruo
Finally, we can get rid of per tree block size members now. Signed-off-by: Qu Wenruo --- ctree.h | 9 - disk-io.c | 3 --- 2 files changed, 12 deletions(-) diff --git a/ctree.h b/ctree.h index 84298c7b..602c9562 100644 --- a/ctree.h +++ b/ctree.h @@ -1166,15

[PATCH 31/32] btrfs-progs: Refactor read_tree_block to get rid of btrfs_root

2017-05-17 Thread Qu Wenruo
The only reasom read_tree_block() needs a btrfs_root parameter is to get its node/sector size. And long ago, I have already introduced a compactible interface, read_tree_block_fs_info() to pass btrfs_fs_info instead of btrfs_root. Since we have cleaned up all root->sector/node/stripesize users,

[PATCH 21/32] btrfs-progs: Refactor sectorsize users in free-space-cache.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- free-space-cache.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/free-space-cache.c b/free-space-cache.c index a4196eb1..4bf4a6cb 100644 --- a/free-space-cache.c +++ b/free-space-cache.c @@ -54,7 +54,8 @@

[PATCH 22/32] btrfs-progs: Refactor sectorsize users in file.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- file.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file.c b/file.c index bf31ccef..028bfba8 100644 --- a/file.c +++ b/file.c @@ -193,10 +193,10 @@ int btrfs_read_file(struct btrfs_root *root, u64 ino, u64

[PATCH 15/32] btrfs-progs: Refactor block sizes users in extent-tree.c

2017-05-17 Thread Qu Wenruo
And in the refactoring, also refactors a open-coded round_up(). Signed-off-by: Qu Wenruo --- extent-tree.c | 38 ++ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/extent-tree.c b/extent-tree.c index b12ee290..43fa3b5f

[PATCH 02/32] btrfs-progs: Introduce sectorsize nodesize and stripesize members for btrfs_fs_info

2017-05-17 Thread Qu Wenruo
Just like what we do in kernel, since we will not support different leaf/node/stripe size per tree, there is no need to store these block sizes in btrfs_root. This patch will introduce these block size members into btrfs_fs_info structure, allowing us to convert such usage in later patches.

[PATCH 06/32] btrfs-progs: Refactor block sizes users in btrfs-map-logical.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfs-map-logical.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index e856b698..e88357fc 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -82,7 +82,7 @@ again:

[PATCH 04/32] btrfs-progs: Refactor block sizes users in btrfs-corrupt-block.c

2017-05-17 Thread Qu Wenruo
Convert root->sectorsize/nodesize users in btrfs-corrupt-block. This provides the basis to further refactor incorrect btrfs_root parameter to btrfs_fs_info parameter. Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 21 ++--- 1 file changed, 10

[PATCH 07/32] btrfs-progs: Refactor block sizes users in chunk-recover.c

2017-05-17 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- chunk-recover.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 96b939a3..08d2f07e 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -1070,7 +1070,7 @@ again:

Re: RAID 6 corrupted

2017-05-17 Thread Adam Borowski
On Thu, May 18, 2017 at 04:09:38AM +0200, Łukasz Wróblewski wrote: > Thanks guys. > > I will try when stable 4.12 comes out. It won't come out for ~2.5 months. I'd recommend building the -rc, recovering, then going back to a stable kernel. > Unfortunately I do not have a backup. > Fortunately,

Re: RAID 6 corrupted

2017-05-17 Thread Łukasz Wróblewski
Thanks guys. I will try when stable 4.12 comes out. Unfortunately I do not have a backup. Fortunately, these data are not so critical. Some private photos and videos of youth. However, I would be very happy if I could get it back. Theoretically, if the devid 4 drive returned to

[PATCH v2] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-17 Thread Darrick J. Wong
Document the new GETFSMAP ioctl that returns the physical layout of a (disk-based) filesystem. Signed-off-by: Darrick J. Wong --- v2: emphasize that filesystems are not obligated to return inode numbers --- man2/ioctl_getfsmap.2 | 375

Re: [PATCH] ioctl_getfsmap.2: document the GETFSMAP ioctl

2017-05-17 Thread Darrick J. Wong
On Sun, May 14, 2017 at 06:56:10AM -0700, Andy Lutomirski wrote: > On Sat, May 13, 2017 at 6:41 PM, Andreas Dilger wrote: > > On May 10, 2017, at 11:10 PM, Eric Biggers wrote: > >> > >> On Wed, May 10, 2017 at 01:14:37PM -0700, Darrick J. Wong wrote: > >>>

[RFC PATCH v3.3 5/6] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions

2017-05-17 Thread Qu Wenruo
Introduce a new parameter, struct extent_changeset for btrfs_qgroup_reserved_data() and its callers. Such extent_changeset was used in btrfs_qgroup_reserve_data() to record which range it reserved in current reserve, so it can free it at error path. The reason we need to export it to callers is,

Re: [RFC PATCH v3.2 5/6] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions

2017-05-17 Thread Qu Wenruo
At 05/17/2017 11:37 PM, David Sterba wrote: On Wed, May 17, 2017 at 10:56:27AM +0800, Qu Wenruo wrote: Introduce a new parameter, struct extent_changeset for btrfs_qgroup_reserved_data() and its callers. Such extent_changeset was used in btrfs_qgroup_reserve_data() to record which range it

[PATCH v2 1/5] fstests: add _filter_filefrag

2017-05-17 Thread Liu Bo
_filter_filefrag is a helper function to filter filefrag's output and it can be used to get a file's file offset and physical offset. Signed-off-by: Liu Bo --- common/filter | 19 +++ 1 file changed, 19 insertions(+) diff --git a/common/filter

[PATCH v2 2/5] fstests: regression test for btrfs dio read repair

2017-05-17 Thread Liu Bo
This case tests whether dio read can repair the bad copy if we have a good copy. Commit 2dabb3248453 ("Btrfs: Direct I/O read: Work on sectorsized blocks") introduced the regression. The upstream fix is Btrfs: fix invalid dereference in btrfs_retry_endio Signed-off-by: Liu Bo

[PATCH v2 4/5] fstests: regression test for nocsum dio read's repair

2017-05-17 Thread Liu Bo
Commit 2dabb3248453 ("Btrfs: Direct I/O read: Work on sectorsized blocks") introduced this regression. It'd cause 'Segmentation fault' error. The upstream fix is Btrfs: fix segment fault when doing dio read Signed-off-by: Liu Bo --- v2: - In order to make the

[PATCH v2 5/5] fstests: regression test for nocsum buffered read's repair

2017-05-17 Thread Liu Bo
This is to test whether buffered read retry-repair code is able to work in raid1 case as expected. Please note that without checksum, btrfs doesn't know if the data used to repair is correct, so repair is more of resync which makes sure that both of the copy has the same content. Commit

[PATCH v2 3/5] fstests: regression test for btrfs buffered read's repair

2017-05-17 Thread Liu Bo
This case tests whether buffered read can repair the bad copy if we have a good copy. Commit 20a7db8ab3f2 ("btrfs: add dummy callback for readpage_io_failed and drop checks") introduced the regression. The upstream fix is Btrfs: bring back repair during read Signed-off-by: Liu Bo

[PATCH v2 0/5] Regression test for btrfs read repair

2017-05-17 Thread Liu Bo
v2: - drop _get_current_dmesg as these patches don't use it any more. - In order to make the tests deterministic, change to check pid for odd/even instead of doing grep with key words in dmesg This set is adding four regression test case for btrfs read repair, and both directIO read and

[PATCH 8/8] Btrfs: hardcode GFP_NOFS for btrfs_bio_clone_partial

2017-05-17 Thread Liu Bo
We only pass GFP_NOFS to btrfs_bio_clone_partial, so lets hardcode it. Signed-off-by: Liu Bo --- fs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 3 +-- fs/btrfs/inode.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent_io.c

[PATCH 6/8] Btrfs: make check-integrity use bvec_iter

2017-05-17 Thread Liu Bo
Some check-integrity code depends on bio->bi_vcnt, this changes it to use bio segments because some bios passing here may not have a reliable bi_vcnt. Signed-off-by: Liu Bo --- fs/btrfs/check-integrity.c | 27 +++ 1 file changed, 15 insertions(+),

[PATCH 0/8 v1] utilize bio_clone_fast to clean up

2017-05-17 Thread Liu Bo
v1: - Drop the RFC tag. - Update to use bio_segments accordingly as __bio_segments is removed. - Remove if (!bio) since bio_clone_fast with bioset and GFP_NOFS will never fail. This attempts to use bio_clone_fast() in the places where we clone bio, such as when bio got cloned for

[PATCH 3/8] Btrfs: use bio_clone_bioset_partial to simplify DIO submit

2017-05-17 Thread Liu Bo
Currently when mapping bio to limit bio to a single stripe length, we split bio by adding page to bio one by one, but later we don't modify the vector of bio at all, thus we can use bio_clone_fast to use the original bio vector directly. Signed-off-by: Liu Bo ---

[PATCH 4/8] Btrfs: change how we iterate bios in endio

2017-05-17 Thread Liu Bo
Since dio submit has used bio_clone_fast, the submitted bio may not have a reliable bi_vcnt, for the bio vector iterations in checksum related functions, bio->bi_iter is not modified yet and it's safe to use bio_for_each_segment, while for those bio vector iterations in dio's read endio, we now

[PATCH 1/8] Btrfs: use bio_clone_fast to clone our bio

2017-05-17 Thread Liu Bo
For raid1 and raid10, we clone the original bio to the bios which are then sent to different disks. Right now we use bio_clone_bioset to create a clone bio with iterating bi_io_vec to initialize it. This changes it to use bio_clone_fast() which creates a clone bio but only copies the bi_io_vec

[PATCH 5/8] Btrfs: record error if one block has failed to retry

2017-05-17 Thread Liu Bo
In the nocsum case of dio read endio, it returns immediately if an error gets returned when repairing, which leaves the rest blocks unrepaired. The behavior is different from how buffered read endio works in the same case. This changes it to record error only and go on repairing the rest blocks.

[PATCH 7/8] Btrfs: unify naming of btrfs_io_bio

2017-05-17 Thread Liu Bo
All dio endio functions are using io_bio for struct btrfs_io_bio, this makes btrfs_submit_direct to follow this convention. Signed-off-by: Liu Bo --- fs/btrfs/inode.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git

[PATCH 2/8] Btrfs: new helper btrfs_bio_clone_partial

2017-05-17 Thread Liu Bo
This adds a new helper btrfs_bio_clone_partial, it'll allocate a cloned bio that only owns a part of the original bio's data. Signed-off-by: Liu Bo --- fs/btrfs/extent_io.c | 18 ++ fs/btrfs/extent_io.h | 2 ++ 2 files changed, 20 insertions(+) diff --git

[fs-btrfs] question about apparent useless function call

2017-05-17 Thread Gustavo A. R. Silva
Hello everybody, While looking into Coverity ID 1398149 I ran into the following piece of code at fs/btrfs/zlib.c:295: 295done: 296zlib_inflateEnd(>strm); 297if (data_in) 298kunmap(pages_in[page_in_index]); 299if (!ret) 300

[PATCH v2] Btrfs: tolerate errors if we have retried successfully

2017-05-17 Thread Liu Bo
With raid1 profile, dio read isn't tolerating IO errors if read length is less than the stripe length (64K). Our bio didn't get split in btrfs_submit_direct_hook() if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) is true and that happens when the read length is less than 64k. In this case, if the

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Noah Massey
On Wed, May 17, 2017 at 4:55 PM, Jeff Mahoney wrote: > On 5/17/17 4:52 PM, Noah Massey wrote: >> On Wed, May 17, 2017 at 4:34 PM, Nikolay Borisov wrote: >>> >>> >>> On 17.05.2017 21:57, Noah Massey wrote: On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Jeff Mahoney
On 5/17/17 4:52 PM, Noah Massey wrote: > On Wed, May 17, 2017 at 4:34 PM, Nikolay Borisov wrote: >> >> >> On 17.05.2017 21:57, Noah Massey wrote: >>> On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov wrote: Currently the struct space_info creation code

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Noah Massey
On Wed, May 17, 2017 at 4:34 PM, Nikolay Borisov wrote: > > > On 17.05.2017 21:57, Noah Massey wrote: >> On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov wrote: >>> Currently the struct space_info creation code is intermixed in the >>> udpate_space_info

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Nikolay Borisov
On 17.05.2017 21:57, Noah Massey wrote: > On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov wrote: >> Currently the struct space_info creation code is intermixed in the >> udpate_space_info function. There are well-defined points at which the we > > ^^^ update_space_info >

Re: [PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Noah Massey
On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov wrote: > Currently the struct space_info creation code is intermixed in the > udpate_space_info function. There are well-defined points at which the we ^^^ update_space_info > actually want to create brand-new space_info

Re: [PATCH v2 2/2] btrfs: Refactor update_space_info

2017-05-17 Thread Noah Massey
minor nitpicks in the comment On Wed, May 17, 2017 at 11:07 AM, Nikolay Borisov wrote: > Following the factoring out of the creation code udpate_space_info can only " code, update_space_info " > be called for already-existing space_info structs. ", which always succeeds"?

Re: [PATCH 1/1] Remove unnecessary branching in free-space-tree.c

2017-05-17 Thread David Sterba
On Wed, May 17, 2017 at 03:33:45AM -0700, Sahil Kang wrote: > Both btrfs_create_free_space_tree and btrfs_clear_free_space_tree > contain: > > if (ret) > return ret; > > return 0; > > The if statement is only false when ret equals zero, and since we return > zero in such cases, we

Re: [PATCH 6/6] Btrfs: unify naming of btrfs_io_bio

2017-05-17 Thread David Sterba
On Mon, Apr 17, 2017 at 06:16:27PM -0700, Liu Bo wrote: > All dio endio functions are using io_bio for struct btrfs_io_bio, this > makes btrfs_submit_direct to follow this convention. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe

Re: [PATCH 4/6] Btrfs: record error if one block has failed to retry

2017-05-17 Thread David Sterba
On Mon, Apr 17, 2017 at 06:16:25PM -0700, Liu Bo wrote: > In the nocsum case of dio read endio, it will return immediately if an > error got returned when repairing, which left the rest blocks unrepaired. > The behavior is different from how buffered read endio works in the same > case. This

Re: 4.11 relocate crash, null pointer + rolling back a filesystem by X hours?

2017-05-17 Thread Kai Krakow
Am Fri, 5 May 2017 08:43:23 -0700 schrieb Marc MERLIN : [missing quote of the command] > > Corrupted blocks are corrupted, that command is just trying to > > corrupt it again. > > It won't do the black magic to adjust tree blocks to avoid them. > > I see. you may hve seen

Re: [PATCH 1/6] Btrfs: use bio_clone_fast to clone our bio

2017-05-17 Thread David Sterba
On Mon, Apr 17, 2017 at 06:16:22PM -0700, Liu Bo wrote: > For raid1 and raid10, we clone the original bio to the bios which are then > sent to different disks. > > Signed-off-by: Liu Bo Reviewed-by: David Sterba -- To unsubscribe from this list: send the

Re: [PATCH 0/3] Kill btree inode prep patches

2017-05-17 Thread David Sterba
On Fri, May 05, 2017 at 11:57:12AM -0400, Josef Bacik wrote: > These three patches are just prep patches for the kill btree inode patch, they > just move some stuff around so we don't depend on struct inode in places where > we won't have one. Once the other supporting generic code goes in I'll

Re: [RFC PATCH 0/2] Introduce blkdev_issue_flush_no_wait()

2017-05-17 Thread David Sterba
On Tue, May 16, 2017 at 02:07:23PM +, Bart Van Assche wrote: > On Tue, 2017-05-16 at 17:39 +0800, Anand Jain wrote: > > BTRFS wanted a block device flush function which does not wait for > > its completion, so that the flush for the next device can be called > > in the same thread. > > > >

Re: [RFC PATCH v3.2 5/6] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions

2017-05-17 Thread David Sterba
On Wed, May 17, 2017 at 10:56:27AM +0800, Qu Wenruo wrote: > Introduce a new parameter, struct extent_changeset for > btrfs_qgroup_reserved_data() and its callers. > > Such extent_changeset was used in btrfs_qgroup_reserve_data() to record > which range it reserved in current reserve, so it can

[PATCH 3/3] btrfs: remove root usage from can_overcommit

2017-05-17 Thread jeffm
From: Jeff Mahoney can_overcommit using the root to determine the allocation profile is the only use of a root in the call graph below reserve_metadata_bytes. It turns out that we only need to know whether the allocation is for the chunk root or not -- and we can pass that

[PATCH 1/3] btrfs: fix race with relocation recovery and fs_root setup

2017-05-17 Thread jeffm
From: Jeff Mahoney If we have to recover relocation during mount, we'll ultimately have to evict the orphan inode. That goes through the reservation dance, where priority_reclaim_metadata_space and flush_space expect fs_info->fs_root to be valid. That's the next thing to be set

[PATCH 2/3] btrfs: cleanup root usage by btrfs_get_alloc_profile

2017-05-17 Thread jeffm
From: Jeff Mahoney There are two places where we don't already know what kind of alloc profile we need before calling btrfs_get_alloc_profile, but we need access to a root everywhere we call it. This patch adds helpers for btrfs_{data,metadata,system}_alloc_profile() and

Re: ERROR: rename o3528-7220-0 -> usr failed: Directory not empty

2017-05-17 Thread Filipe Manana
On Tue, May 2, 2017 at 3:52 AM, J. Hart wrote: > On 05/01/2017 02:52 PM, Filipe Manana wrote: >> >> On Mon, May 1, 2017 at 4:17 PM, J. Hart wrote: >> Just use "btrfs-image -c 9 /dev/whatever image_file", it will create a >> compressed image where the

[PATCH 1/2] btrfs-progs: Fix restoring image from multi devices fs into single device

2017-05-17 Thread fdmanana
From: Filipe Manana We correctly build an image from a multiple devices filesystem but when restoring the image into a single device we were missing updating the number of devices in the superblock to the value 1 (we already took care of setting the number of stripes to 1 for

[PATCH 2/2] btrfs-progs: test for restoring multiple devices fs into a single device

2017-05-17 Thread fdmanana
From: Filipe Manana Test that we are able to create an image from a multiple devices fs, that we are able to restore that image into a single device and finally that we are able to mount it. Signed-off-by: Filipe Manana ---

Re: Can't remount a BTRFS partition read write after a drive failure

2017-05-17 Thread Ivan Sizov
2017-05-16 15:56 GMT+03:00 Sylvain Leroux : > > > The drive is not reliable. And I noticed when there is an error and the > USB device appears to be dead to the kernel, I am later unable to > remount rw the drive. I can mount it read only though. > > This seems to be a

[PATCH v2 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Nikolay Borisov
Currently the struct space_info creation code is intermixed in the udpate_space_info function. There are well-defined points at which the we actually want to create brand-new space_info structs (e.g. during mount of the filesystem as well as sometimes when adding/initialising new chunks). In such

[PATCH v2 2/2] btrfs: Refactor update_space_info

2017-05-17 Thread Nikolay Borisov
Following the factoring out of the creation code udpate_space_info can only be called for already-existing space_info structs. Remove superfulous error handling and use the return value to return a pointer to the found space_info. Signed-off-by: Nikolay Borisov Reviewed-by:

[PATCH] btrfs: use correct types for page indices in btrfs_page_exists_in_range

2017-05-17 Thread David Sterba
Variables start_idx and end_idx are supposed to hold a page index derived from the file offsets. The int type is not the right one though, offsets larger than 1 << 44 will get silently trimmed off the high bits. (1 << 44 is 16TiB) What can go wrong, if start is below the boundary and end gets

[PATCH] btrfs: fix bool type in btrfs_page_exists_in_range

2017-05-17 Thread David Sterba
We use only a simple bool indicator, int is not a problem here. Signed-off-by: David Sterba --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5e71f1ea3391..85591d3f3ad9 100644 ---

Re: [PATCH 1/2] btrfs: Separate space_info create/update

2017-05-17 Thread Jeff Mahoney
On 5/9/17 4:34 AM, Nikolay Borisov wrote: > Currently the struct space_info creation code is intermixed in the > udpate_space_info function. There are well-defined points at which the we > actually want to create brand-new space_info structs (e.g. during mount of > the filesystem as well as

Re: [PATCH 2/2] btrfs: Refactor update_space_info

2017-05-17 Thread Jeff Mahoney
On 5/9/17 4:34 AM, Nikolay Borisov wrote: > Following the factoring out of the creation code udpate_space_info can only > be called for already-existing space_info structs. As such it cannot fail. > Remove superfulous error handling and make the function return void. > > Signed-off-by: Nikolay

[PATCH] btrfs: fix memory leak in update_space_info failure path

2017-05-17 Thread jeffm
From: Jeff Mahoney If we fail to add the space_info kobject, we'll leak the memory for the percpu counter. Fixes: 6ab0a2029c (btrfs: publish allocation data in sysfs) Cc: # v3.14+ Signed-off-by: Jeff Mahoney --- fs/btrfs/extent-tree.c |

[PATCH 1/1] Remove unnecessary branching in free-space-tree.c

2017-05-17 Thread Sahil Kang
Both btrfs_create_free_space_tree and btrfs_clear_free_space_tree contain: if (ret) return ret; return 0; The if statement is only false when ret equals zero, and since we return zero in such cases, we can safely remove the branching. Signed-off-by: Sahil Kang

[PATCH 0/1] Remove unnecessary branching in free-space-tree.c

2017-05-17 Thread Sahil Kang
Hi David, Will you merge this patch? It's a small change that removes an unneeded if statement. Sahil Kang (1): Remove unnecessary branching in free-space-tree.c fs/btrfs/free-space-tree.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.1.4 -- To unsubscribe from

Re: RAID 6 corrupted

2017-05-17 Thread Adam Borowski
On Wed, May 17, 2017 at 09:52:28AM +, Duncan wrote: > Łukasz Wróblewski posted on Wed, 17 May 2017 10:27:53 +0200 as excerpted: > > About two years ago I created RAID 6 consisting of 5 disks with BTRFS. > > One of the disks has crashed. > > I started to exchange it for another, but I did

Re: RAID 6 corrupted

2017-05-17 Thread Duncan
Duncan posted on Wed, 17 May 2017 09:52:28 + as excerpted: > For anything raid56 related, you'll need at /least/ 4.11, as it has some > major raid56 stability patch updates. Oops. Looks like it's even fresher than that, 4.12-rc1, according to Adam's reply. I thought I read that it hit

Re: btrfs hang with 4.11.1 kernel

2017-05-17 Thread Duncan
Tomasz Chmielewski posted on Wed, 17 May 2017 17:44:02 +0900 as excerpted: > After upgrading to 4.11.1 and running for ~12 hours, btrfs filesystem > hanged - most processes on a server accessing the filesystem went into > "D" state and blocked. > > The server would not reboot and had to be power

Re: RAID 6 corrupted

2017-05-17 Thread Duncan
Łukasz Wróblewski posted on Wed, 17 May 2017 10:27:53 +0200 as excerpted: > About two years ago I created RAID 6 consisting of 5 disks with BTRFS. > One of the disks has crashed. > I started to exchange it for another, but I did something wrong. > Or at the time, RAID56 support was experimental

Re: RAID 6 corrupted

2017-05-17 Thread Adam Borowski
On Wed, May 17, 2017 at 10:27:53AM +0200, Łukasz Wróblewski wrote: > About two years ago I created RAID 6 consisting of 5 disks with BTRFS. > One of the disks has crashed. > I started to exchange it for another, but I did something wrong. > Or at the time, RAID56 support was experimental in BTRFS.

Re: Can't remount a BTRFS partition read write after a drive failure

2017-05-17 Thread Duncan
Sylvain Leroux posted on Tue, 16 May 2017 14:56:37 +0200 as excerpted: > I'm investigating BTRFS using an external USB HDD on a Linux Debian > Stretch/Sid system. > > The drive is not reliable. And I noticed when there is an error and the > USB device appears to be dead to the kernel, I am later

btrfs hang with 4.11.1 kernel

2017-05-17 Thread Tomasz Chmielewski
After upgrading to 4.11.1 and running for ~12 hours, btrfs filesystem hanged - most processes on a server accessing the filesystem went into "D" state and blocked. The server would not reboot and had to be power cycled. Previously, it was running 4.10.7 for around 1.5 month without any

RAID 6 corrupted

2017-05-17 Thread Łukasz Wróblewski
Hi, About two years ago I created RAID 6 consisting of 5 disks with BTRFS. One of the disks has crashed. I started to exchange it for another, but I did something wrong. Or at the time, RAID56 support was experimental in BTRFS. There was a situation where I could not mount the partition again. I

Re: [PATCH 0/5] btrfs-progs: check: simple errors repair in lowmem

2017-05-17 Thread Su Yue
Hi This patchset was sent a month ago. Since it's a start of lowmem repair patches, I hope to get some opinions about it. Thanks Su Yue On 04/11/2017 11:26 AM, Su Yue wrote: The series include following contents: 1) Repair wrong nbytes of file inode item. After traversal of