Re: Broken filesystem, looking for guidance

2018-11-19 Thread Sébastien Luttringer
On Mon, 2018-11-19 at 14:28 +0800, Qu Wenruo wrote: > > On 2018/11/19 下午1:23, Sébastien Luttringer wrote: > > On Mon, 2018-11-19 at 13:00 +0800, Qu Wenruo wrote: > > From 20181029, it may be possible with extra help from btrfs-progs > developers. But at current point, it's near impossible to

Re: [PATCH] Btrfs: fix race between enabling quotas and subvolume creation

2018-11-19 Thread Qu Wenruo
On 2018/11/20 上午12:20, fdman...@kernel.org wrote: > From: Filipe Manana > > We have a race between enabling quotas end subvolume creation that cause > subvolume creation to fail with -EINVAL, and the following diagram shows > how it happens: > > CPU 0

Re: [PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午11:24, Filipe Manana wrote: > On Mon, Nov 19, 2018 at 2:48 PM Qu Wenruo wrote: >> >> >> >> On 2018/11/19 下午10:15, fdman...@kernel.org wrote: >>> From: Filipe Manana >>> >>> If the quota enable and snapshot creation ioctls are called concurrently >>> we can get into a deadlock

Re: [PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午11:36, Nikolay Borisov wrote: > > > On 19.11.18 г. 16:48 ч., Qu Wenruo wrote: >> There may be some qgroup reserved space related problem in such case, >> but I'm not 100% sure to foresee such problem. > > But why is this a problem - we always queue quota rescan following

Re: [PATCH v2] btrfs: add zstd compression level support

2018-11-19 Thread Omar Sandoval
On Tue, Nov 13, 2018 at 01:33:32AM +0100, David Sterba wrote: > On Wed, Oct 31, 2018 at 11:11:08AM -0700, Nick Terrell wrote: > > From: Jennifer Liu > > > > Adds zstd compression level support to btrfs. Zstd requires > > different amounts of memory for each level, so the design had > > to be

Re: [PATCH v2] btrfs: add zstd compression level support

2018-11-19 Thread Omar Sandoval
On Tue, Nov 13, 2018 at 04:29:33PM +0300, Timofey Titovets wrote: > вт, 13 нояб. 2018 г. в 04:52, Nick Terrell : > > > > > > > > > On Nov 12, 2018, at 4:33 PM, David Sterba wrote: > > > > > > On Wed, Oct 31, 2018 at 11:11:08AM -0700, Nick Terrell wrote: > > >> From: Jennifer Liu > > >> > > >>

Re: bad tree block start, want 705757184 have 82362368

2018-11-19 Thread Stephan Olbrich
Am Sonntag, 18. November 2018, 14:31:36 CET schrieb Anand Jain: > On 11/18/2018 03:56 PM, Stephan Olbrich wrote: > > Am Sonntag, 18. November 2018, 01:30:14 CET schrieb Qu Wenruo: > > Late on I got the same errors for my /home partition (on the same > > drive) > > as well. I have

Re: [PATCH v5 1/3] btrfs: add helper function describe_block_group()

2018-11-19 Thread David Sterba
On Wed, Nov 14, 2018 at 09:17:10PM +0800, Anand Jain wrote: > Improve on describe_relocation() add a common helper function to describe > the block groups. > > Signed-off-by: Anand Jain > Reviewed-by: David Sterba > --- > v4.1->v5: Initialize buf[128] to null. > v4->v4.1: Use strcpy(buf,

Re: [PATCH v5 2/3] btrfs: balance: add args info during start and resume

2018-11-19 Thread David Sterba
On Wed, Nov 14, 2018 at 09:17:11PM +0800, Anand Jain wrote: > Balance arg info is an important information to be reviewed for the > system audit. So this patch adds them to the kernel log. > > Example: > ->btrfs bal start -f -mprofiles=raid1,convert=single,soft > -dlimit=10..20,usage=50 /btrfs >

[PATCH] Btrfs: fix race between enabling quotas and subvolume creation

2018-11-19 Thread fdmanana
From: Filipe Manana We have a race between enabling quotas end subvolume creation that cause subvolume creation to fail with -EINVAL, and the following diagram shows how it happens: CPU 0 CPU 1 btrfs_ioctl() btrfs_ioctl_quota_ctl()

Re: [PATCH] btrfs: Add sysfs support for metadata_uuid feature

2018-11-19 Thread David Sterba
On Mon, Nov 19, 2018 at 05:37:45PM +0200, Nikolay Borisov wrote: > Since the metadata_uuid is a new incompat feature it requires the > respective sysfs hooks. This patch adds the 'metdata_uuid' feature to > be shown if it supported by the kernel. Additionally it adds >

[PATCH] btrfs: Add sysfs support for metadata_uuid feature

2018-11-19 Thread Nikolay Borisov
Since the metadata_uuid is a new incompat feature it requires the respective sysfs hooks. This patch adds the 'metdata_uuid' feature to be shown if it supported by the kernel. Additionally it adds /sys/fs/btrfs/UUID/metadata_uuid attribute which allows one to read the current metadata_uuid.

Re: [PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Nikolay Borisov
On 19.11.18 г. 16:48 ч., Qu Wenruo wrote: > There may be some qgroup reserved space related problem in such case, > but I'm not 100% sure to foresee such problem. But why is this a problem - we always queue quota rescan following QUOTA enable, that should take care of proper accounting, no? >

Re: [PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Filipe Manana
On Mon, Nov 19, 2018 at 2:48 PM Qu Wenruo wrote: > > > > On 2018/11/19 下午10:15, fdman...@kernel.org wrote: > > From: Filipe Manana > > > > If the quota enable and snapshot creation ioctls are called concurrently > > we can get into a deadlock where the task enabling quotas will deadlock > > on

Re: [PATCH v6 2/2] btrfs: Add zstd support to grub btrfs

2018-11-19 Thread Daniel Kiper
On Mon, Nov 19, 2018 at 03:22:51PM +0100, Daniel Kiper wrote: > On Thu, Nov 15, 2018 at 02:36:03PM -0800, Nick Terrell wrote: > > - Adds zstd support to the btrfs module. > > - Adds a test case for btrfs zstd support. > > - Changes top_srcdir to srcdir in the btrfs module's lzo include > >

Re: [PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午10:15, fdman...@kernel.org wrote: > From: Filipe Manana > > If the quota enable and snapshot creation ioctls are called concurrently > we can get into a deadlock where the task enabling quotas will deadlock > on the fs_info->qgroup_ioctl_lock mutex because it attempts to lock

Re: [PATCH v2 0/5] btrfs: fix compiler warning with make W=1

2018-11-19 Thread David Sterba
On Mon, Nov 19, 2018 at 10:38:12AM +0100, Johannes Thumshirn wrote: > This patchset fixes most of the compiler warnings encountered when building > btrfs with make W=1. > > There are two more compiler warnings left in raid56.c: > CC [M] fs/btrfs/raid56.o > fs/btrfs/raid56.c: In function

Re: [PATCH v6 2/2] btrfs: Add zstd support to grub btrfs

2018-11-19 Thread Daniel Kiper
On Thu, Nov 15, 2018 at 02:36:03PM -0800, Nick Terrell wrote: > - Adds zstd support to the btrfs module. > - Adds a test case for btrfs zstd support. > - Changes top_srcdir to srcdir in the btrfs module's lzo include > following comments from Daniel Kiper about the zstd include. > > Tested on

Re: [PATCH v2 3/5] btrfs: remove unused function btrfs_sysfs_feature_update()

2018-11-19 Thread David Sterba
On Mon, Nov 19, 2018 at 10:38:15AM +0100, Johannes Thumshirn wrote: > btrfs_sysfs_feature_update() was introduced with commit 444e75169872 (btrfs: > sysfs: introduce helper for syncing bits with sysfs files) to provide a helper > which was used in 14e46e04958d (btrfs: synchronize incompat feature

[PATCH v2] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread fdmanana
From: Filipe Manana If the quota enable and snapshot creation ioctls are called concurrently we can get into a deadlock where the task enabling quotas will deadlock on the fs_info->qgroup_ioctl_lock mutex because it attempts to lock it twice, or the task creating a snapshot tries to commit the

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Filipe Manana
On Mon, Nov 19, 2018 at 11:52 AM Filipe Manana wrote: > > On Mon, Nov 19, 2018 at 11:35 AM Qu Wenruo wrote: > > > > > > > > On 2018/11/19 下午7:13, Filipe Manana wrote: > > > On Mon, Nov 19, 2018 at 11:09 AM Qu Wenruo wrote: > > >> > > >> > > >> > > >> On 2018/11/19 下午5:48, fdman...@kernel.org

Re: [PATCH v2 2/5] btrfs: remove set but not used variable err in btrfs_add_link

2018-11-19 Thread David Sterba
On Mon, Nov 19, 2018 at 10:38:14AM +0100, Johannes Thumshirn wrote: > err holds the return value of either btrfs_del_root_ref() or > btrfs_del_inode_ref() but it hasn't been checked since it's introduction with > commit fe66a05a0679 (Btrfs: improve error handling for btrfs_insert_dir_item >

Re: [PATCH v3 0/6] FSID change kernel support

2018-11-19 Thread David Sterba
On Tue, Oct 30, 2018 at 04:43:22PM +0200, Nikolay Borisov wrote: > Here is the 3rd submission for the kernel counterpart of the uuid change > patchset. The only difference is that I (hope) have adressed all cosmetic > feedback from David as well as have reworded some change logs to ease >

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午7:52, Filipe Manana wrote: > On Mon, Nov 19, 2018 at 11:35 AM Qu Wenruo wrote: >> >> >> >> On 2018/11/19 下午7:13, Filipe Manana wrote: >>> On Mon, Nov 19, 2018 at 11:09 AM Qu Wenruo wrote: On 2018/11/19 下午5:48, fdman...@kernel.org wrote: > From: Filipe

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Filipe Manana
On Mon, Nov 19, 2018 at 11:35 AM Qu Wenruo wrote: > > > > On 2018/11/19 下午7:13, Filipe Manana wrote: > > On Mon, Nov 19, 2018 at 11:09 AM Qu Wenruo wrote: > >> > >> > >> > >> On 2018/11/19 下午5:48, fdman...@kernel.org wrote: > >>> From: Filipe Manana > >>> > >>> If the quota enable and snapshot

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午7:13, Filipe Manana wrote: > On Mon, Nov 19, 2018 at 11:09 AM Qu Wenruo wrote: >> >> >> >> On 2018/11/19 下午5:48, fdman...@kernel.org wrote: >>> From: Filipe Manana >>> >>> If the quota enable and snapshot creation ioctls are called concurrently >>> we can get into a deadlock

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Filipe Manana
On Mon, Nov 19, 2018 at 11:09 AM Qu Wenruo wrote: > > > > On 2018/11/19 下午5:48, fdman...@kernel.org wrote: > > From: Filipe Manana > > > > If the quota enable and snapshot creation ioctls are called concurrently > > we can get into a deadlock where the task enabling quotas will deadlock > > on

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Qu Wenruo
On 2018/11/19 下午5:48, fdman...@kernel.org wrote: > From: Filipe Manana > > If the quota enable and snapshot creation ioctls are called concurrently > we can get into a deadlock where the task enabling quotas will deadlock > on the fs_info->qgroup_ioctl_lock mutex because it attempts to lock it

Re: [PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread Nikolay Borisov
On 19.11.18 г. 11:48 ч., fdman...@kernel.org wrote: > From: Filipe Manana > > If the quota enable and snapshot creation ioctls are called concurrently > we can get into a deadlock where the task enabling quotas will deadlock > on the fs_info->qgroup_ioctl_lock mutex because it attempts to

Re: [PATCH] Btrfs: fix access to available allocation bits when starting balance

2018-11-19 Thread Nikolay Borisov
On 19.11.18 г. 11:48 ч., fdman...@kernel.org wrote: > From: Filipe Manana > > The available allocation bits members from struct btrfs_fs_info are > protected by a sequence lock, and when starting balance we access them > incorrectly in two different ways: > > 1) In the read sequence lock

Re: [PATCH v2 5/5] btrfs: use EXPORT_FOR_TESTS for conditionally shared functions

2018-11-19 Thread Nikolay Borisov
On 19.11.18 г. 11:38 ч., Johannes Thumshirn wrote: > Several functions in BTRFS are only used inside the source file they are > declared if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not defined. However if > CONFIG_BTRFS_FS_RUN_SANITY_TESTS is defined these functions are shared with > the unit tests

Re: [PATCH v2 4/5] btrfs: introduce EXPORT_FOR_TESTS macro

2018-11-19 Thread Nikolay Borisov
On 19.11.18 г. 11:38 ч., Johannes Thumshirn wrote: > Depending on whether CONFIG_BTRFS_FS_RUN_SANITY_TESTS is set, some BTRFS > functions are either local to the file they are implemented in and thus > should be declared static or are called from within the test implementation > defined in a

[PATCH] Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation

2018-11-19 Thread fdmanana
From: Filipe Manana If the quota enable and snapshot creation ioctls are called concurrently we can get into a deadlock where the task enabling quotas will deadlock on the fs_info->qgroup_ioctl_lock mutex because it attempts to lock it twice. The following time diagram shows how this happens.

[PATCH] Btrfs: fix access to available allocation bits when starting balance

2018-11-19 Thread fdmanana
From: Filipe Manana The available allocation bits members from struct btrfs_fs_info are protected by a sequence lock, and when starting balance we access them incorrectly in two different ways: 1) In the read sequence lock loop at btrfs_balance() we use the values we read from

[PATCH v2 4/5] btrfs: introduce EXPORT_FOR_TESTS macro

2018-11-19 Thread Johannes Thumshirn
Depending on whether CONFIG_BTRFS_FS_RUN_SANITY_TESTS is set, some BTRFS functions are either local to the file they are implemented in and thus should be declared static or are called from within the test implementation defined in a different file. Introduce an EXPORT_FOR_TESTS macro which

[PATCH v2 0/5] btrfs: fix compiler warning with make W=1

2018-11-19 Thread Johannes Thumshirn
This patchset fixes most of the compiler warnings encountered when building btrfs with make W=1. There are two more compiler warnings left in raid56.c: CC [M] fs/btrfs/raid56.o fs/btrfs/raid56.c: In function ‘finish_rmw’: fs/btrfs/raid56.c:1185:6: warning: variable ‘p_stripe’ set but not used

[PATCH v2 3/5] btrfs: remove unused function btrfs_sysfs_feature_update()

2018-11-19 Thread Johannes Thumshirn
btrfs_sysfs_feature_update() was introduced with commit 444e75169872 (btrfs: sysfs: introduce helper for syncing bits with sysfs files) to provide a helper which was used in 14e46e04958d (btrfs: synchronize incompat feature bits with sysfs files). But commit e410e34fad91 (Revert "btrfs:

[PATCH v2 2/5] btrfs: remove set but not used variable err in btrfs_add_link

2018-11-19 Thread Johannes Thumshirn
err holds the return value of either btrfs_del_root_ref() or btrfs_del_inode_ref() but it hasn't been checked since it's introduction with commit fe66a05a0679 (Btrfs: improve error handling for btrfs_insert_dir_item callers) in 2012. As the error value hasn't been of any interest for 6 years we

[PATCH v2 5/5] btrfs: use EXPORT_FOR_TESTS for conditionally shared functions

2018-11-19 Thread Johannes Thumshirn
Several functions in BTRFS are only used inside the source file they are declared if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not defined. However if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is defined these functions are shared with the unit tests code. Before the introduction of the EXPORT_FOR_TESTS macro,

[PATCH v2 1/5] btrfs: remove unused drop_on_err in btrfs_mkdir()

2018-11-19 Thread Johannes Thumshirn
Up to commit 32955c5422a8 (btrfs: switch to discard_new_inode()) the drop_on_err variable in btrfs_mkdir() was used to check whether the inode had to be dropped via iput(). After commit 32955c5422a8 (btrfs: switch to discard_new_inode()) discard_new_inode() is called when err is set and inode is

Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:58:03PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in blk_queue_split() for > > fast

Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:18:11PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in blk_queue_split() for > > fast

Re: [PATCH V10 17/19] block: don't use bio->bi_vcnt to figure out segment number

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:11:40PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:04PM +0800, Ming Lei wrote: > > It is wrong to use bio->bi_vcnt to figure out how many segments > > there are in the bio even though CLONED flag isn't set on this bio, > > because this bio may be

Re: [PATCH V10 15/19] block: always define BIO_MAX_PAGES as 256

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:59:36PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:02PM +0800, Ming Lei wrote: > > Now multi-page bvec can cover CONFIG_THP_SWAP, so we don't need to > > increase BIO_MAX_PAGES for it. > > You mentioned to it in the cover letter, but this needs more

Re: [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:53:08PM +0100, Christoph Hellwig wrote: > > - > > - if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len) { > > - bv->bv_len += len; > > - bio->bi_iter.bi_size += len; > > - return true; > > -

Re: [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:56:27PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:01PM +0800, Ming Lei wrote: > > This patch pulls the trigger for multi-page bvecs. > > > > Now any request queue which supports queue cluster will see multi-page > > bvecs. > > > > Cc: Dave Chinner >

Re: [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:49:36PM +0100, Christoph Hellwig wrote: > I'd much rather have __bio_try_merge_page only do merges in > the same page, and have a new __bio_try_merge_segment that does > multi-page merges. This will keep the accounting a lot simpler. Looks this way is clever, will do

Re: [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:46:58PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:00PM +0800, Ming Lei wrote: > > After multi-page is enabled, one new page may be merged to a segment > > even though it is a new added page. > > > > This patch deals with this issue by post-check in

Re: [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:22:45PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > This patch introduces one extra iterator variable to > > bio_for_each_segment_all(), > > then we can allow bio_for_each_segment_all() to iterate over multi-page > >

Re: [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 01:42:52PM +0100, David Sterba wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > diff --git a/block/blk-zoned.c b/block/blk-zoned.c > > index 13ba2011a306..789b09ae402a 100644 > > --- a/block/blk-zoned.c > > +++ b/block/blk-zoned.c > > @@ -123,6 +123,7

Re: [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:46:45PM +0100, Christoph Hellwig wrote: > > - bio_for_each_segment_all(bv, bio, i) { > > + for (i = 0, bv = bio->bi_io_vec; i < bio->bi_vcnt; bv++) { > > This really needs a comment. Otherwise it looks fine to me. OK, will do it in next version. Thanks, Ming

Re: [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:44:02PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:58PM +0800, Ming Lei wrote: > > bch_bio_alloc_pages() is always called on one new bio, so it is safe > > to access the bvec table directly. Given it is the only kind of this > > case, open code the bvec

Re: [PATCH V10 10/19] block: loop: pass multi-page bvec to iov_iter

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:40:22PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:57PM +0800, Ming Lei wrote: > > iov_iter is implemented with bvec itererator, so it is safe to pass > > multipage bvec to it, and this way is much more efficient than > > passing one page in each bvec. >

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Christoph Hellwig
On Mon, Nov 19, 2018 at 04:19:24PM +0800, Ming Lei wrote: > On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > > BTRFS is the only user of this helper, so move this helper into > > > BTRFS, and implement it via

Re: [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:45:41PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:56PM +0800, Ming Lei wrote: > > There are still cases in which we need to use bio_bvecs() for get the > > number of multi-page segment, so introduce it. > > The only user in your final tree seems to

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt may not equal to

Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:23:56PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt may not equal to number

Re: [PATCH V10 07/19] btrfs: use bvec_last_segment to get bio's last page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:37:10PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:54PM +0800, Ming Lei wrote: > > index 2955a4ea2fa8..161e14b8b180 100644 > > --- a/fs/btrfs/compression.c > > +++ b/fs/btrfs/compression.c > > @@ -400,8 +400,11 @@ blk_status_t