Re: Fwd: Questions about how BtrFS works.

2017-06-13 Thread Qu Wenruo
At 06/14/2017 01:29 AM, Hy Che wrote: -- Forwarded message -- From: Hy Che Date: Sun, Jun 11, 2017 at 10:45 PM Subject: Re: Questions about how BtrFS works. To: Nikolay Borisov Sorry for sending privately, I did't know clicked on

Re: Lock between userspace and btrfs-cleaner on extent_buffer

2017-06-13 Thread Sargun Dhillon
On Thu, Jun 8, 2017 at 11:34 AM, Sargun Dhillon wrote: > I have a deadlock caught in the wild between two processes -- > btrfs-cleaner, and userspace process (Docker). Here, you can see both > of the backtraces. btrfs-cleaner is trying to get a lock on > 9859d360caf0, which

[PATCH v2 0/2] Btrfs: if else cleanups

2017-06-13 Thread Timofey Titovets
Both patches just make code more readable Changes since v1: - Drop controversial patches from patchset for now Timofey Titovets (2): Btrfs: ref_tree_add remove useless compare Btrfs: add_all_parents skip compare fs/btrfs/backref.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v2 2/2] Btrfs: add_all_parents skip compare

2017-06-13 Thread Timofey Titovets
Simplify code to make it more readable Signed-off-by: Timofey Titovets --- fs/btrfs/backref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 0005b8851..2081a8de7 100644 --- a/fs/btrfs/backref.c +++

[PATCH v2 1/2] Btrfs: ref_tree_add remove useless compare

2017-06-13 Thread Timofey Titovets
Remove useless compare to make it more readable Signed-off-by: Timofey Titovets --- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 24865da63..0005b8851 100644 --- a/fs/btrfs/backref.c +++

Re: [PATCH 7/7] Btrfs: warn if total_bytes_pinned is non-zero on unmount

2017-06-13 Thread Jeff Mahoney
On 6/6/17 7:45 PM, Omar Sandoval wrote: > From: Omar Sandoval > > Catch any future/remaining leaks or underflows of total_bytes_pinned. > > Signed-off-by: Omar Sandoval > --- > fs/btrfs/extent-tree.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Fwd: Questions about how BtrFS works.

2017-06-13 Thread Hy Che
-- Forwarded message -- From: Hy Che Date: Sun, Jun 11, 2017 at 10:45 PM Subject: Re: Questions about how BtrFS works. To: Nikolay Borisov Sorry for sending privately, I did't know clicked on 'Replay' is not sent to the mailing list.

Re: [PATCH 1/3 v2.1] btrfs: write_dev_flush does not return ENOMEM anymore

2017-06-13 Thread David Sterba
On Tue, Jun 13, 2017 at 05:32:29PM +0800, Anand Jain wrote: > As commit > 9035b5dbc576 btrfs: btrfs_io_bio_alloc never fails, skip error handling > > removed the -ENOMEM return from write_dev_flush()/send-part so no need to > check for the -ENOMEM during send. > > Signed-off-by: Anand Jain

Re: [PATCH 6/7] Btrfs: __tree_mod_log_insert decrease max compare count

2017-06-13 Thread David Sterba
On Wed, Jun 07, 2017 at 02:01:46PM +0300, Timofey Titovets wrote: > 2017-06-07 12:45 GMT+03:00 Filipe Manana : > > On Wed, Jun 7, 2017 at 1:58 AM, Timofey Titovets > > wrote: > >> In worst case code do 4 comparison, > >> just add some new checks to

Re: [PATCH v6] Btrfs: compression must free at least one sector size

2017-06-13 Thread David Sterba
On Tue, Jun 06, 2017 at 02:41:15PM +0300, Timofey Titovets wrote: > Btrfs already skip store of data where compression didn't > free at least one byte. Let's make logic better and make check > that compression free at least one sector size > because in another case it useless to store this data

Re: [PATCH v3] Btrfs: change how we iterate bios in endio

2017-06-13 Thread David Sterba
On Mon, Jun 12, 2017 at 11:05:12AM -0600, Liu Bo wrote: > 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,

Re: [PATCH] btrfs: use ino_t for inode in tracer

2017-06-13 Thread David Sterba
On Tue, Jun 13, 2017 at 04:12:10PM +0800, Anand Jain wrote: > > > On 06/13/2017 02:41 PM, Christoph Hellwig wrote: > > I thought btrfs supports 64-bit inodes, in which case this will > > truncate the inode number on 32-bit architectures. > > Good catch. Thanks ! > > Will send the updated

Re: csum failed root -9

2017-06-13 Thread Henk Slager
On Tue, Jun 13, 2017 at 7:24 AM, Kai Krakow wrote: > Am Mon, 12 Jun 2017 11:00:31 +0200 > schrieb Henk Slager : > >> Hi all, >> >> there is 1-block corruption a 8TB filesystem that showed up several >> months ago. The fs is almost exclusively a btrfs

Re: [xfstests PATCH v4 0/5] new tests for writeback error reporting behavior

2017-06-13 Thread Jeff Layton
On Tue, 2017-06-13 at 16:32 +0800, Eryu Guan wrote: > On Mon, Jun 12, 2017 at 08:42:08AM -0400, Jeff Layton wrote: > > v4: respin set based on Eryu's comments > > > > These tests are companion tests to the patchset I recently posted with > > the cover letter: > > > > [PATCH v6 00/20] fs:

Re: [PATCH v6 19/20] xfs: minimal conversion to errseq_t writeback error reporting

2017-06-13 Thread Jeff Layton
On Mon, 2017-06-12 at 21:30 -0700, Darrick J. Wong wrote: > On Mon, Jun 12, 2017 at 08:23:15AM -0400, Jeff Layton wrote: > > Just set the FS_WB_ERRSEQ flag to indicate that we want to use errseq_t > > based error reporting. Internal filemap_* calls are left as-is for now. > > > > Signed-off-by:

Re: [PATCH v6 12/20] fs: add a new fstype flag to indicate how writeback errors are tracked

2017-06-13 Thread Jeff Layton
On Mon, 2017-06-12 at 05:45 -0700, Christoph Hellwig wrote: > On Mon, Jun 12, 2017 at 08:23:06AM -0400, Jeff Layton wrote: > > Add a new FS_WB_ERRSEQ flag to the fstype. Later patches will set and > > key off of that to decide what behavior should be used. > > Please invert this so that only file

[PATCH 1/3 v2.1] btrfs: write_dev_flush does not return ENOMEM anymore

2017-06-13 Thread Anand Jain
As commit 9035b5dbc576 btrfs: btrfs_io_bio_alloc never fails, skip error handling removed the -ENOMEM return from write_dev_flush()/send-part so no need to check for the -ENOMEM during send. Signed-off-by: Anand Jain --- v2.1: Part of commit log got missed out during

[PATCH 16/19] btrfs-progs: Refactor btrfs_chunk_readonly to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- extent-tree.c | 2 +- volumes.c | 6 +++--- volumes.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extent-tree.c b/extent-tree.c index 9aa47c55..683cb583 100644 --- a/extent-tree.c +++ b/extent-tree.c @@

[PATCH 00/19] fs_info refactor part 2 (disk-io.h and volumes.h based)

2017-06-13 Thread Qu Wenruo
This is the part 2 patchset to refactor btrfs_root usage to btrfs_fs_info. The most obvious advantage is to make function calls a little shorter, and less confused. Function calls like btrfs_alloc_data_chunk() needs caller to pass a btrfs_root parameter, while the parameter should always be

[PATCH 08/19] btrfs-progs: Refactor read_extent_data to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfs-map-logical.c | 2 +- cmds-check.c| 18 ++ disk-io.c | 8 disk-io.h | 2 +- file.c | 15 --- image/main.c| 3 ++- 6 files changed, 26

[PATCH 04/19] btrfs-progs: Refactor csum_tree_block to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- disk-io.c | 14 -- utils.h | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/disk-io.c b/disk-io.c index 9d2408c2..bf00e195 100644 --- a/disk-io.c +++ b/disk-io.c @@ -164,8 +164,8 @@ int

[PATCH 14/19] btrfs-progs: Refactor btrfs_read_sys_array/chunk_tree to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- disk-io.c | 4 ++-- volumes.c | 25 +++-- volumes.h | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/disk-io.c b/disk-io.c index a11e6262..8cf800ea 100644 --- a/disk-io.c +++ b/disk-io.c @@

[PATCH 07/19] btrfs-progs: btrfstune: Refactor change_devices_uuid to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfstune.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/btrfstune.c b/btrfstune.c index 580fb401..2d85b041 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -177,10 +177,9 @@ out: return ret; } -static int

[PATCH 01/19] btrfs-progs: Refactor btrfs_map_block and its variants to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Just to keep the 1st paramter the same as kernel. We can also save a few lines since the parameter is shorter now. Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 5 ++--- btrfs-map-logical.c | 5 ++--- cmds-check.c | 2 +- cmds-restore.c| 4

[PATCH 02/19] btrfs-progs: Refactor btrfs_num_copies to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfs-corrupt-block.c | 4 ++-- btrfs-map-logical.c | 2 +- cmds-check.c | 3 +-- cmds-restore.c| 6 ++ disk-io.c | 3 +-- image/main.c | 3 +-- volumes.c | 3 ++- volumes.h

[PATCH 03/19] btrfs-progs: Refactor btrfs_next_bg and its callers to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- find-root.c | 4 ++-- volumes.c | 5 +++-- volumes.h | 14 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/find-root.c b/find-root.c index 1b41b217..1765adf8 100644 --- a/find-root.c +++ b/find-root.c @@

[PATCH 06/19] btrfs-progs: Refactor write_tree_block to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfstune.c | 6 +++--- disk-io.c | 17 + disk-io.h | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/btrfstune.c b/btrfstune.c index b5a1c2fe..580fb401 100644 --- a/btrfstune.c +++ b/btrfstune.c

[PATCH 12/19] btrfs-progs: Refactor btrfs_check_chunk_valid to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-check.c | 6 +++--- volumes.c| 9 + volumes.h| 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index bd6c4e75..b10d0020 100644 --- a/cmds-check.c +++ b/cmds-check.c @@

[PATCH 09/19] btrfs-progs: Refactor btrfs_find_tree_block to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-check.c | 16 +--- ctree.c | 5 +++-- disk-io.c | 6 +++--- disk-io.h | 2 +- extent-tree.c | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index

[PATCH 19/19] btrfs-progs: Refactor chunk creation functions to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
4 functions are involved in this refactor: btrfs_make_block_group() btrfs_make_block_groups(), btrfs_alloc_chunk, btrfs_alloc_data_chunk(). Signed-off-by: Qu Wenruo --- convert/main.c | 4 ++-- ctree.h| 4 ++-- extent-tree.c | 45

[PATCH 17/19] btrfs-progs: Refactor btrfs_add_device() to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
BTW, there is a duplicated definition of btrfs_add_device() in volumes.h, also remove it. Signed-off-by: Qu Wenruo --- utils.c | 11 ++- volumes.c | 7 +++ volumes.h | 5 + 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/utils.c

[PATCH 15/19] btrfs-progs: Refactor btrfs_add_system_chunk to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- chunk-recover.c | 5 +++-- volumes.c | 7 +++ volumes.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 90791fbd..f1fa7504 100644 --- a/chunk-recover.c +++

[PATCH 11/19] btrfs-progs: Refactor write_all_supers and its callers to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- btrfs-select-super.c | 2 +- btrfstune.c | 6 +++--- disk-io.c| 48 disk-io.h| 4 ++-- super-recover.c | 2 +- 5 files changed, 31 insertions(+), 31

[PATCH 13/19] btrfs-progs: Refactor btrfs_find_device to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- chunk-recover.c | 5 +++-- volumes.c | 27 ++- volumes.h | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 08d2f07e..90791fbd 100644 ---

[PATCH 05/19] btrfs-progs: Refactor write_and_map_eb to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- convert/main.c | 2 +- disk-io.c | 8 disk-io.h | 2 +- mkfs/main.c| 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/convert/main.c b/convert/main.c index bf050132..103cd5cd 100644 ---

[PATCH 18/19] btrfs-progs: Remove btrfs_read_super_device as there is no implementation

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- volumes.h | 1 - 1 file changed, 1 deletion(-) diff --git a/volumes.h b/volumes.h index 0f82281f..68bd98ae 100644 --- a/volumes.h +++ b/volumes.h @@ -212,7 +212,6 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, int

[PATCH 10/19] btrfs-progs: Refactor btrfs_readahead_tree_block to use btrfs_fs_info

2017-06-13 Thread Qu Wenruo
Signed-off-by: Qu Wenruo --- cmds-check.c | 8 +--- ctree.c | 2 +- disk-io.c| 8 disk-io.h| 4 ++-- image/main.c | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index b9c21553..bd6c4e75

Re: [PATCH 1/2] btrfs: write_dev_flush does not return ENOMEM anymore

2017-06-13 Thread Anand Jain
On 06/13/2017 12:14 AM, David Sterba wrote: On Fri, Jun 09, 2017 at 02:52:28PM +0800, Anand Jain wrote: Commit 9035b5dbc576 btrfs: btrfs_io_bio_alloc never fails, skip error handling removed the -ENOMEM return from write_dev_flush() so no need to check for the -ENOMEM during send. This

[PATCH 1/3 v2] btrfs: write_dev_flush does not return ENOMEM anymore

2017-06-13 Thread Anand Jain
As commit 9035b5dbc576 btrfs: btrfs_io_bio_alloc never fails, skip error handling removed the -ENOMEM return from write_dev_flush() Signed-off-by: Anand Jain --- v2: . Add the removal of submit_flush_error in check_barrier_error() from 2/2 before to 1/3 here, as its

[PATCH 3/3 v2] btrfs: wait part of the write_dev_flush() can be separated out

2017-06-13 Thread Anand Jain
Submit and wait parts of write_dev_flush() can be split into two separate functions for better readability. Signed-off-by: Anand Jain --- v2: new in v2 fs/btrfs/disk-io.c | 60 -- 1 file changed, 31 insertions(+), 29

[PATCH 2/3 v2] btrfs: remove redundant null bdev counting during flush submit

2017-06-13 Thread Anand Jain
There is no extra benefit to count null bdev during submit loop, as these null devices will be anyway checked during command completion device loop just after the submit loop, and as we are holding the device_list_mutex, the device->bdev status won't change in between. Signed-off-by: Anand Jain

Re: [xfstests PATCH v4 5/5] btrfs: make a btrfs version of writeback error reporting test

2017-06-13 Thread Eryu Guan
On Mon, Jun 12, 2017 at 08:42:13AM -0400, Jeff Layton wrote: > Make a new btrfs/999 test that works the way Chris Mason suggested: > > Build a filesystem with 2 devices that stripes the data across > both devices, but mirrors metadata across both. Then, make one > of the devices fail and see how

Re: [xfstests PATCH v4 2/5] ext4: allow ext4 to use $SCRATCH_LOGDEV

2017-06-13 Thread Eryu Guan
On Mon, Jun 12, 2017 at 08:42:10AM -0400, Jeff Layton wrote: > The writeback error handling test requires that you put the journal on a > separate device. This allows us to use dmerror to simulate data > writeback failure, without affecting the journal. > > xfs already has infrastructure for this

Re: [xfstests PATCH v4 1/5] generic: add a writeback error handling test

2017-06-13 Thread Eryu Guan
On Mon, Jun 12, 2017 at 08:42:09AM -0400, Jeff Layton wrote: > I'm working on a set of kernel patches to change how writeback errors > are handled and reported in the kernel. Instead of reporting a > writeback error to only the first fsync caller on the file, I aim > to make the kernel report them

Re: [xfstests PATCH v4 0/5] new tests for writeback error reporting behavior

2017-06-13 Thread Eryu Guan
On Mon, Jun 12, 2017 at 08:42:08AM -0400, Jeff Layton wrote: > v4: respin set based on Eryu's comments > > These tests are companion tests to the patchset I recently posted with > the cover letter: > > [PATCH v6 00/20] fs: enhanced writeback error reporting with errseq_t > (pile #1) > >

Re: [PATCH] btrfs: use ino_t for inode in tracer

2017-06-13 Thread Anand Jain
On 06/13/2017 02:41 PM, Christoph Hellwig wrote: I thought btrfs supports 64-bit inodes, in which case this will truncate the inode number on 32-bit architectures. Good catch. Thanks ! Will send the updated patch. Thanks, Anand -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] btrfs: use ino_t for inode in tracer

2017-06-13 Thread Christoph Hellwig
I thought btrfs supports 64-bit inodes, in which case this will truncate the inode number on 32-bit architectures. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 0/10 v11] No wait AIO

2017-06-13 Thread Christoph Hellwig
On Mon, Jun 12, 2017 at 05:38:13PM -0500, Goldwyn Rodrigues wrote: > We had FS_NOWAIT in filesystem type flags (in v3), but retracted it > later in v4. A per-fs flag is wrong as file_operation may have different capabilities. > I will work on adding FMODE_AIO_NOWAIT in the meantime. If Al