Re: [PATCH v2 3/3] btrfs-progs: check: Cleanup all checkpatch error and warning

2018-01-31 Thread Qu Wenruo
On 2018年02月01日 15:08, Su Yue wrote: > > > On 02/01/2018 02:45 PM, Qu Wenruo wrote: >> Since we're moving tons of codes, it's a good idea to fix all errors and [snip] >>   } >> @@ -2500,7 +2507,8 @@ static int repair_extent_data_item(struct >> btrfs_trans_handle *trans, >>  

[josef-btrfs:current-work 2/2] block/blk-wbt.h:113:8: error: redefinition of 'struct rq_qos'

2018-01-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 055b23681aedfe6c6a9da010a57b3d6d9167f882 commit: 055b23681aedfe6c6a9da010a57b3d6d9167f882 [2/2] current-work config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 7.2.0

Re: [PATCH v2 3/3] btrfs-progs: check: Cleanup all checkpatch error and warning

2018-01-31 Thread Su Yue
On 02/01/2018 02:45 PM, Qu Wenruo wrote: Since we're moving tons of codes, it's a good idea to fix all errors and warnings from checkpatch. Signed-off-by: Qu Wenruo --- check/lowmem.c | 65 +-- check/main.c | 253

[josef-btrfs:current-work 2/2] block/blk-wbt.c:323:20: error: implicit declaration of function 'calc_wb_limits'

2018-01-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git current-work head: 055b23681aedfe6c6a9da010a57b3d6d9167f882 commit: 055b23681aedfe6c6a9da010a57b3d6d9167f882 [2/2] current-work config: m68k-allyesconfig (attached as .config) compiler: m68k-linux-gnu-gcc (Debian

[PATCH v2 0/3] btrfs-progs: Split lowmem mode check to its own

2018-01-31 Thread Qu Wenruo
As usual, the main part is over 500K so the biggest patch won't reach mail list. Please fetch the whole branch from github: https://github.com/adam900710/btrfs-progs/tree/split_check This update rebased (the truth is, it's re-created other than rebase) the branch to David's devel branch, whose

[PATCH v2 3/3] btrfs-progs: check: Cleanup all checkpatch error and warning

2018-01-31 Thread Qu Wenruo
Since we're moving tons of codes, it's a good idea to fix all errors and warnings from checkpatch. Signed-off-by: Qu Wenruo --- check/lowmem.c | 65 +-- check/main.c | 253 + 2 files changed, 165

[PATCH v2 2/3] btrfs-progs: check/lowmem: Cleanup unnecessary _v2 suffix

2018-01-31 Thread Qu Wenruo
There used to be some functions with _v2 suffix to distinguish them from original mode similar functions. However now moved lowmem code to their own check/lowmem.[ch], cleanup such _v2 suffixes, and for functions really needs to be distinguished from original mode (exported functions), change the

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Edmund Nadolski
On 1/31/18 7:36 AM, Anand Jain wrote: > > > On 01/31/2018 09:42 PM, Nikolay Borisov wrote: > > So usually this should be functionality handled by the raid/san controller I guess, > but given that btrfs is playing the role of a controller here at what point are we drawing the

Re: [PATCH 00/16] btrfs-progs: Split lowmem mode check to its own

2018-01-31 Thread Qu Wenruo
On 2018年02月01日 02:26, David Sterba wrote: > On Fri, Jan 19, 2018 at 01:37:15PM +0800, Qu Wenruo wrote: >> The long planned cmds-check re-construction is finally here. >> >> As the original cmds-check.c is getting larger and larger (already over >> 15K lines), it's always a good idea to split it

[PATCH v2] Btrfs: fix unexpected cow in run_delalloc_nocow

2018-01-31 Thread Liu Bo
Fstests generic/475 provides a way to fail metadata reads while checking if checksum exists for the inode inside run_delalloc_nocow(), and csum_exist_in_range() interprets error (-EIO) as inode having checksum and makes its caller enters the cow path. In case of free space inode, this ends up

Re: [PATCH 00/16] btrfs-progs: Split lowmem mode check to its own

2018-01-31 Thread David Sterba
On Fri, Jan 19, 2018 at 01:37:15PM +0800, Qu Wenruo wrote: > The long planned cmds-check re-construction is finally here. > > As the original cmds-check.c is getting larger and larger (already over > 15K lines), it's always a good idea to split it into its own check/ > directory. > > This

Re: [PATCH v2] iversion: make inode_cmp_iversion{+raw} return bool instead of s64

2018-01-31 Thread Jeff Layton
On Wed, 2018-01-31 at 08:46 -0800, Linus Torvalds wrote: > On Wed, Jan 31, 2018 at 4:29 AM, Jeff Layton wrote: > > > > Do you mind just taking it directly? I don't have anything else queued > > up for this cycle. > > Done. > Thanks...and also many thanks for spotting the

Re: [PATCH v2] iversion: make inode_cmp_iversion{+raw} return bool instead of s64

2018-01-31 Thread Linus Torvalds
On Wed, Jan 31, 2018 at 4:29 AM, Jeff Layton wrote: > > Do you mind just taking it directly? I don't have anything else queued > up for this cycle. Done. I wonder if "false for same, true for different" calling convention makes much sense, but it matches the old "0 for same"

Re: [PATCH 0/2] Policy to balance read across mirrored devices

2018-01-31 Thread Peter Becker
ok, i understood the commitmessage as if the behavior for tests is more of a bonus 2018-01-30 7:30 GMT+01:00 Anand Jain : > This __also__ helps testing then it's clear to me. would only be good that this behavior is documented. not that anyone else, like me, tries to use

Re: [PATCH] btrfs-progs: fsck-tests: Rename tree-reloc-tree test number

2018-01-31 Thread David Sterba
On Wed, Jan 31, 2018 at 10:40:36AM +0800, Qu Wenruo wrote: > There are 2 fsck tests with the same number 027: > tree-reloc-tree > bad-extent-inline-ref-type > > And we also have a hole in 015, so just rename tree-reloc-tree to 015, > to get rid of the duplicated test number and fill in the hole.

Re: [PATCH v3 7/7] btrfs-progs: Cleanup use of root in leaf_data_end

2018-01-31 Thread David Sterba
On Wed, Jan 31, 2018 at 11:09:19AM +0800, Gu Jinxiang wrote: > In function leaf_data_end, root is just used to get fs_info, > so change the parameter of this function from btrfs_root to > btrfs_fs_info. > And also make it consistent with kernel. > > Changelog: > v3->v2: > Add const to parameter

Re: [PATCH v2 0/7] btrfs-progs: Do some clean up to be consistent

2018-01-31 Thread David Sterba
On Fri, Jan 26, 2018 at 04:18:55PM +0800, Qu Wenruo wrote: > > > On 2018年01月26日 15:25, Gu Jinxiang wrote: > > Patch 1~4 and 7: clean up use of btrfs_root. > > Patch 5: remove redundancy value assignment. > > Patch 6: remove no longer be used function define. > > Overall it looks good, just one

Re: [PATCH v2 7/7] btrfs-progs: Cleanup use of root in leaf_data_end

2018-01-31 Thread David Sterba
On Tue, Jan 30, 2018 at 03:36:28PM +0800, Qu Wenruo wrote: > On 2018年01月26日 15:26, Gu Jinxiang wrote: > > In function leaf_data_end, root is just used to get fs_info, > > so change the parameter of this function from btrfs_root to > > btrfs_fs_info. > > And also make it consistent with kernel. > >

Re: [PATCH 0/2] Policy to balance read across mirrored devices

2018-01-31 Thread Austin S. Hemmelgarn
On 2018-01-31 09:52, Peter Becker wrote: This is all clear. My question referes to "use the lower devid disk containing the stripe" 2018-01-31 10:01 GMT+01:00 Anand Jain : When a stripe is not present on the read optimized disk it will just use the lower devid disk

Re: [PATCH] Btrfs: fix null pointer dereference when replacing missing device

2018-01-31 Thread David Sterba
On Wed, Jan 31, 2018 at 11:25:49AM +0800, Anand Jain wrote: > > This is trivially reproduced by running the test btrfs/027 from fstests > > like this: > > > >$ MOUNT_OPTIONS="-o discard" ./check btrfs/027 > > > > Fix this by skipping devices without a backing device before attempting > > to

Re: [PATCH v2 1/2] btrfs: Refactor __get_raid_index() to btrfs_bg_flags_to_raid_index()

2018-01-31 Thread David Sterba
On Tue, Jan 30, 2018 at 06:20:45PM +0800, Qu Wenruo wrote: > Function __get_raid_index() is used to convert block group flags into > raid index, which can be used to get various info directly from > btrfs_raid_array[]. > > Refactor this function a little: > > 1) Rename to

[PATCH v2] btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster

2018-01-31 Thread Nikolay Borisov
Essentially duplicate the error handling from the above block which handles the !PageUptodate(page) case and additionally clear EXTENT_BOUNDARY. Signed-off-by: Nikolay Borisov Reviewed-by: Josef Bacik --- V2: * Remove unrelated whitespace fix

Re: [PATCH] btrfs: volumes: Cleanup stripe size calculation

2018-01-31 Thread David Sterba
On Wed, Jan 31, 2018 at 02:16:34PM +0800, Qu Wenruo wrote: > Cleanup the following things: > 1) open coded SZ_16M round up > 2) use min() to replace open-coded size comparison > 3) code style > > Signed-off-by: Qu Wenruo Added to next, thanks. -- To unsubscribe from this list:

Re: [PATCH v2] btrfs: remove spurious WARN_ON(ref->count < 0) in find_parent_nodes

2018-01-31 Thread David Sterba
On Wed, Jan 24, 2018 at 11:33:08AM +0800, Lu Fengqi wrote: > On Tue, Jan 23, 2018 at 10:22:09PM -0500, Zygo Blaxell wrote: > >Until v4.14, this warning was very infrequent: > > > > WARNING: CPU: 3 PID: 18172 at fs/btrfs/backref.c:1391 > > find_parent_nodes+0xc41/0x14e0 > > Modules linked

Btrfs progs pre-release 4.15-rc1

2018-01-31 Thread David Sterba
Hi, a pre-release has been tagged. The only significant change is removing the custom chunk allocator from mkfs for the --rootdir option. ETA for 4.15 is in +2 days (2018-02-02). Changes: * mkfs --rootdir reworked, does not minimize the final image but can be still done using a new option

Re: [RESEND PATCH] btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster

2018-01-31 Thread David Sterba
On Wed, Jan 31, 2018 at 12:53:38PM +0200, Nikolay Borisov wrote: > > This is an unrelated change. Please don't mix pure white > > space/indentation changes with functional changes. > > David seems rather adamant in not accepting pure whitespace/indention > changes on their own so I don't see a

Re: [PATCH 0/2] Policy to balance read across mirrored devices

2018-01-31 Thread Peter Becker
This is all clear. My question referes to "use the lower devid disk containing the stripe" 2018-01-31 10:01 GMT+01:00 Anand Jain : > When a stripe is not present on the read optimized disk it will just > use the lower devid disk containing the stripe (instead of failing

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Anand Jain
On 01/31/2018 09:42 PM, Nikolay Borisov wrote: So usually this should be functionality handled by the raid/san controller I guess, > but given that btrfs is playing the role of a controller here at what point are we drawing the line of not implementing block-level functionality into the

Re: [PATCH 0/2] Policy to balance read across mirrored devices

2018-01-31 Thread Anand Jain
On 01/31/2018 06:47 PM, Peter Becker wrote: 2018-01-31 10:01 GMT+01:00 Anand Jain : When a stripe is not present on the read optimized disk it will just use the lower devid disk containing the stripe (instead of failing back to the pid based random disk). Is

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Nikolay Borisov
On 31.01.2018 15:38, Anand Jain wrote: > > > On 01/31/2018 05:54 PM, Nikolay Borisov wrote: >> >> >> On 31.01.2018 11:28, Anand Jain wrote: >>> >>> >>> On 01/31/2018 04:38 PM, Nikolay Borisov wrote: On 30.01.2018 08:30, Anand Jain wrote: > Adds the mount option: >    

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Anand Jain
On 01/31/2018 05:54 PM, Nikolay Borisov wrote: On 31.01.2018 11:28, Anand Jain wrote: On 01/31/2018 04:38 PM, Nikolay Borisov wrote: On 30.01.2018 08:30, Anand Jain wrote: Adds the mount option:    mount -o read_mirror_policy= To set the devid of the device which should be used for

Re: [PATCH v2] iversion: make inode_cmp_iversion{+raw} return bool instead of s64

2018-01-31 Thread Jeff Layton
On Tue, 2018-01-30 at 12:53 -0800, Linus Torvalds wrote: > Ack. Should I expect this in a future pull request, or take it directly? > > There's no hurry about this, since none of the existing users of that > function actually do anything but test the return value against zero, > and nobody saves

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Anand Jain
On 01/31/2018 04:38 PM, Nikolay Borisov wrote: On 30.01.2018 08:30, Anand Jain wrote: Adds the mount option: mount -o read_mirror_policy= To set the devid of the device which should be used for read. That means all the normal reads will go to that particular device only. This also

Re: [PATCH 1/2] btrfs: add mount option read_mirror_policy

2018-01-31 Thread Anand Jain
On 01/31/2018 04:06 PM, Nikolay Borisov wrote: diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1a462ab85c49..4759e988b0df 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -1100,6 +1100,8 @@ struct btrfs_fs_info { spinlock_t ref_verify_lock; struct rb_root

Re: [PATCH 0/2] Policy to balance read across mirrored devices

2018-01-31 Thread Anand Jain
On 01/31/2018 03:51 PM, Peter Becker wrote: A little question about mount -o read_mirror_policy=. How would this work with RAID1 over 3 or 4 HDD's? In particular, if the desired block is not available on device . When a stripe is not present on the read optimized disk it will just use the

[PATCH] btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable

2018-01-31 Thread Nikolay Borisov
Currently btrfs_run_qgroups is doing a bit too much. Not only is it responsible for synchronizing in-memory state of qgroups to disk but it also contains code to trigger the initial qgroup rescan when quota is enabled initially. This condition is detected by checking that BTRFS_FS_QUOTA_ENABLED is

Re: [PATCH] btrfs: volumes: Remove the meaningless condition of minimal nr_devs when allocating a chunk

2018-01-31 Thread Qu Wenruo
On 2018年01月31日 15:35, Nikolay Borisov wrote: > > > On 31.01.2018 07:56, Qu Wenruo wrote: >> When checking the minimal nr_devs, there is one dead and meaningless >> condition: >> >> if (ndevs < devs_increment * sub_stripes || ndevs < devs_min) { >> >> >>

Re: [PATCH 2/2] btrfs: add read_mirror_policy parameter devid

2018-01-31 Thread Nikolay Borisov
On 30.01.2018 08:30, Anand Jain wrote: > Adds the mount option: > mount -o read_mirror_policy= > > To set the devid of the device which should be used for read. That > means all the normal reads will go to that particular device only. > > This also helps testing and gives a better control

RE: [PATCH] btrfs: volumes: Cleanup stripe size calculation

2018-01-31 Thread Gu, Jinxiang
> -Original Message- > From: linux-btrfs-ow...@vger.kernel.org > [mailto:linux-btrfs-ow...@vger.kernel.org] > On Behalf Of Qu Wenruo > Sent: Wednesday, January 31, 2018 2:17 PM > To: linux-btrfs@vger.kernel.org; dste...@suse.cz > Subject: [PATCH] btrfs: volumes: Cleanup stripe size

Re: [PATCH 1/2] btrfs: add mount option read_mirror_policy

2018-01-31 Thread Nikolay Borisov
On 30.01.2018 08:30, Anand Jain wrote: > In case of RAID1 and RAID10 devices are mirror-ed, a read IO can > pick any device for reading. This choice of picking a device for > reading should be configurable. In short not one policy would > satisfy all types of workload and configs. > > So before