linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-13  3:15 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-13  3:15 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Christoph Hellwig

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/compression.c

between commit:

  c1045c6859c1 ("btrfs: opencode trivial compressed_bio_alloc, simplify error handling")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (the former removed one of the hunks fo code updated by the
latter) and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be mentioned
to your upstream maintainer when your tree is submitted for merging.
You may also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2019-02-18  1:07 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2019-02-18  1:07 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Qu Wenruo, Ming Lei

[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/extent_io.c

between commit:

  2ce8afc500de ("btrfs: extent_io: Kill the forward declaration of flush_write_bio")

from the btrfs-kdave tree and commit:

  c3a7ce738009 ("btrfs: use mp_bvec_last_segment to get bio's last page")

from the block tree.

I fixed it up (the former moved the function updated by the latter - see
below) and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be mentioned
to your upstream maintainer when your tree is submitted for merging.
You may also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index ca259c75bbcd,4ed58c9a94a9..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -147,38 -147,7 +147,39 @@@ static int add_extent_changeset(struct 
  	return ret;
  }
  
 -static void flush_write_bio(struct extent_page_data *epd);
 +static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
 +				       unsigned long bio_flags)
 +{
 +	blk_status_t ret = 0;
 +	struct bio_vec *bvec = bio_last_bvec_all(bio);
- 	struct page *page = bvec->bv_page;
++	struct bio_vec bv;
 +	struct extent_io_tree *tree = bio->bi_private;
 +	u64 start;
 +
- 	start = page_offset(page) + bvec->bv_offset;
++	mp_bvec_last_segment(bvec, &bv);
++	start = page_offset(bv.bv_page) + bv.bv_offset;
 +
 +	bio->bi_private = NULL;
 +
 +	if (tree->ops)
 +		ret = tree->ops->submit_bio_hook(tree->private_data, bio,
 +					   mirror_num, bio_flags, start);
 +	else
 +		btrfsic_submit_bio(bio);
 +
 +	return blk_status_to_errno(ret);
 +}
 +
 +static void flush_write_bio(struct extent_page_data *epd)
 +{
 +	if (epd->bio) {
 +		int ret;
 +
 +		ret = submit_one_bio(epd->bio, 0, 0);
 +		BUG_ON(ret < 0); /* -ENOMEM */
 +		epd->bio = NULL;
 +	}
 +}
  
  int __init extent_io_init(void)
  {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-21  3:13 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-21  3:13 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Christoph Hellwig

Hi all,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/disk-io.c

between commits:

  21445903e814 ("btrfs: preallocate device flush bio")
  56305f3eb397 ("btrfs: move dev stats accounting out of wait_dev_flush")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index b6758892874f,6036d15b47b8..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -87,8 -87,9 +87,8 @@@ struct btrfs_end_io_wq 
  	bio_end_io_t *end_io;
  	void *private;
  	struct btrfs_fs_info *info;
- 	int error;
+ 	blk_status_t status;
  	enum btrfs_wq_endio_type metadata;
 -	struct list_head list;
  	struct btrfs_work work;
  };
  
@@@ -867,10 -868,10 +867,10 @@@ unsigned long btrfs_async_submit_limit(
  static void run_one_async_start(struct btrfs_work *work)
  {
  	struct async_submit_bio *async;
- 	int ret;
+ 	blk_status_t ret;
  
  	async = container_of(work, struct  async_submit_bio, work);
 -	ret = async->submit_bio_start(async->inode, async->bio,
 +	ret = async->submit_bio_start(async->private_data, async->bio,
  				      async->mirror_num, async->bio_flags,
  				      async->bio_offset);
  	if (ret)
@@@ -915,20 -916,19 +915,20 @@@ static void run_one_async_free(struct b
  	kfree(async);
  }
  
- int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
 -blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info,
 -		struct inode *inode, struct bio *bio, int mirror_num,
 -		unsigned long bio_flags, u64 bio_offset,
 -		extent_submit_bio_hook_t *submit_bio_start,
 -		extent_submit_bio_hook_t *submit_bio_done)
++blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
 +			int mirror_num, unsigned long bio_flags,
 +			u64 bio_offset, void *private_data,
 +			extent_submit_bio_hook_t *submit_bio_start,
 +			extent_submit_bio_hook_t *submit_bio_done)
  {
  	struct async_submit_bio *async;
  
  	async = kmalloc(sizeof(*async), GFP_NOFS);
  	if (!async)
- 		return -ENOMEM;
+ 		return BLK_STS_RESOURCE;
  
 -	async->inode = inode;
 +	async->private_data = private_data;
 +	async->fs_info = fs_info;
  	async->bio = bio;
  	async->mirror_num = mirror_num;
  	async->submit_bio_start = submit_bio_start;
@@@ -971,12 -971,12 +971,12 @@@ static blk_status_t btree_csum_one_bio(
  			break;
  	}
  
- 	return ret;
+ 	return errno_to_blk_status(ret);
  }
  
- static int __btree_submit_bio_start(void *private_data, struct bio *bio,
 -static blk_status_t __btree_submit_bio_start(struct inode *inode,
 -		struct bio *bio, int mirror_num, unsigned long bio_flags,
 -		u64 bio_offset)
++static blk_status_t __btree_submit_bio_start(void *private_data, struct bio *bio,
 +				    int mirror_num, unsigned long bio_flags,
 +				    u64 bio_offset)
  {
  	/*
  	 * when we're called for a write, we're already in the async
@@@ -985,12 -985,11 +985,12 @@@
  	return btree_csum_one_bio(bio);
  }
  
- static int __btree_submit_bio_done(void *private_data, struct bio *bio,
 -static blk_status_t __btree_submit_bio_done(struct inode *inode,
 -		struct bio *bio, int mirror_num, unsigned long bio_flags,
 -		u64 bio_offset)
++static blk_status_t __btree_submit_bio_done(void *private_data, struct bio *bio,
 +				 int mirror_num, unsigned long bio_flags,
 +				 u64 bio_offset)
  {
 +	struct inode *inode = private_data;
- 	int ret;
+ 	blk_status_t ret;
  
  	/*
  	 * when we're called for a write, we're already in the async
@@@ -1015,14 -1014,13 +1015,14 @@@ static int check_async_write(unsigned l
  	return 1;
  }
  
- static int btree_submit_bio_hook(void *private_data, struct bio *bio,
 -static blk_status_t btree_submit_bio_hook(struct inode *inode, struct bio *bio,
++static blk_status_t btree_submit_bio_hook(void *private_data, struct bio *bio,
  				 int mirror_num, unsigned long bio_flags,
  				 u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	int async = check_async_write(bio_flags);
- 	int ret;
+ 	blk_status_t ret;
  
  	if (bio_op(bio) != REQ_OP_WRITE) {
  		/*
@@@ -3485,57 -3490,59 +3485,57 @@@ static void btrfs_end_empty_barrier(str
  }
  
  /*
 - * trigger flushes for one the devices.  If you pass wait == 0, the flushes are
 - * sent down.  With wait == 1, it waits for the previous flush.
 - *
 - * any device where the flush fails with eopnotsupp are flagged as not-barrier
 - * capable
 + * Submit a flush request to the device if it supports it. Error handling is
 + * done in the waiting counterpart.
   */
 -static blk_status_t write_dev_flush(struct btrfs_device *device, int wait)
 +static void write_dev_flush(struct btrfs_device *device)
  {
  	struct request_queue *q = bdev_get_queue(device->bdev);
 -	struct bio *bio;
 -	blk_status_t ret = 0;
 +	struct bio *bio = device->flush_bio;
  
  	if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
 -		return 0;
 +		return;
  
 -	if (wait) {
 -		bio = device->flush_bio;
 -		if (!bio)
 -			return 0;
 +	bio_reset(bio);
 +	bio->bi_end_io = btrfs_end_empty_barrier;
 +	bio->bi_bdev = device->bdev;
 +	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
 +	init_completion(&device->flush_wait);
 +	bio->bi_private = &device->flush_wait;
  
 -		wait_for_completion(&device->flush_wait);
 +	submit_bio(bio);
 +	device->flush_bio_sent = 1;
 +}
  
 -		if (bio->bi_status) {
 -			ret = bio->bi_status;
 -			btrfs_dev_stat_inc_and_print(device,
 -				BTRFS_DEV_STAT_FLUSH_ERRS);
 -		}
 +/*
 + * If the flush bio has been submitted by write_dev_flush, wait for it.
 + */
- static int wait_dev_flush(struct btrfs_device *device)
++static blk_status_t wait_dev_flush(struct btrfs_device *device)
 +{
 +	struct bio *bio = device->flush_bio;
  
 -		/* drop the reference from the wait == 0 run */
 -		bio_put(bio);
 -		device->flush_bio = NULL;
 +	if (!device->flush_bio_sent)
 +		return 0;
  
 -		return ret;
 -	}
 +	device->flush_bio_sent = 0;
 +	wait_for_completion_io(&device->flush_wait);
  
- 	return bio->bi_error;
 -	/*
 -	 * one reference for us, and we leave it for the
 -	 * caller
 -	 */
 -	device->flush_bio = NULL;
 -	bio = btrfs_io_bio_alloc(GFP_NOFS, 0);
 -	if (!bio)
 -		return BLK_STS_RESOURCE;
++	return bio->bi_status;
 +}
  
 -	bio->bi_end_io = btrfs_end_empty_barrier;
 -	bio->bi_bdev = device->bdev;
 -	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
 -	init_completion(&device->flush_wait);
 -	bio->bi_private = &device->flush_wait;
 -	device->flush_bio = bio;
 +static int check_barrier_error(struct btrfs_fs_devices *fsdevs)
 +{
 +	int dev_flush_error = 0;
 +	struct btrfs_device *dev;
  
 -	bio_get(bio);
 -	btrfsic_submit_bio(bio);
 +	list_for_each_entry_rcu(dev, &fsdevs->devices, dev_list) {
 +		if (!dev->bdev || dev->last_flush_error)
 +			dev_flush_error++;
 +	}
 +
 +	if (dev_flush_error >
 +	    fsdevs->fs_info->num_tolerated_disk_barrier_failures)
 +		return -EIO;
  
  	return 0;
  }
@@@ -3548,8 -3555,9 +3548,8 @@@ static int barrier_all_devices(struct b
  {
  	struct list_head *head;
  	struct btrfs_device *dev;
 -	int errors_send = 0;
  	int errors_wait = 0;
- 	int ret;
+ 	blk_status_t ret;
  
  	/* send down all the barriers */
  	head = &info->fs_devices->devices;

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-20  1:37 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-20  1:37 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Josef Bacik, Liu Bo, Guoqing Jiang

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/inode.c

between commits:

  c6100a4b4e3d ("Btrfs: replace tree->mapping with tree->private_data")
  725130bac585 ("Btrfs: use bio_clone_bioset_partial to simplify DIO submit")
  3892ac9086a8 ("Btrfs: unify naming of btrfs_io_bio")
  054ec2f626ed ("btrfs: simplify code with bio_io_error")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/inode.c
index 5d3c6ac960fd,f942293dd7e7..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -1900,12 -1900,11 +1899,12 @@@ int btrfs_merge_bio_hook(struct page *p
   * At IO completion time the cums attached on the ordered extent record
   * are inserted into the btree
   */
- static int __btrfs_submit_bio_start(void *private_data, struct bio *bio,
 -static blk_status_t __btrfs_submit_bio_start(struct inode *inode,
 -		struct bio *bio, int mirror_num, unsigned long bio_flags,
 -		u64 bio_offset)
++static blk_status_t __btrfs_submit_bio_start(void *private_data, struct bio *bio,
 +				    int mirror_num, unsigned long bio_flags,
 +				    u64 bio_offset)
  {
 +	struct inode *inode = private_data;
- 	int ret = 0;
+ 	blk_status_t ret = 0;
  
  	ret = btrfs_csum_one_bio(inode, bio, 0, 0);
  	BUG_ON(ret); /* -ENOMEM */
@@@ -1920,13 -1919,12 +1919,13 @@@
   * At IO completion time the cums attached on the ordered extent record
   * are inserted into the btree
   */
- static int __btrfs_submit_bio_done(void *private_data, struct bio *bio,
 -static blk_status_t __btrfs_submit_bio_done(struct inode *inode,
 -		struct bio *bio, int mirror_num, unsigned long bio_flags,
 -		u64 bio_offset)
++static blk_status_t __btrfs_submit_bio_done(void *private_data, struct bio *bio,
 +			  int mirror_num, unsigned long bio_flags,
 +			  u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
- 	int ret;
+ 	blk_status_t ret;
  
  	ret = btrfs_map_bio(fs_info, bio, mirror_num, 1);
  	if (ret) {
@@@ -1940,11 -1938,10 +1939,11 @@@
   * extent_io.c submission hook. This does the right thing for csum calculation
   * on write, or reading the csums from the tree before a read
   */
- static int btrfs_submit_bio_hook(void *private_data, struct bio *bio,
 -static blk_status_t btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
 -			  int mirror_num, unsigned long bio_flags,
 -			  u64 bio_offset)
++static blk_status_t btrfs_submit_bio_hook(void *private_data, struct bio *bio,
 +				 int mirror_num, unsigned long bio_flags,
 +				 u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	struct btrfs_root *root = BTRFS_I(inode)->root;
  	enum btrfs_wq_endio_type metadata = BTRFS_WQ_ENDIO_DATA;
@@@ -8046,12 -8033,10 +8045,12 @@@ struct btrfs_retry_complete 
  static void btrfs_retry_endio_nocsum(struct bio *bio)
  {
  	struct btrfs_retry_complete *done = bio->bi_private;
 +	struct inode *inode = done->inode;
  	struct bio_vec *bvec;
 +	struct extent_io_tree *io_tree, *failure_tree;
  	int i;
  
- 	if (bio->bi_error)
+ 	if (bio->bi_status)
  		goto end;
  
  	ASSERT(bio->bi_vcnt == 1);
@@@ -8171,12 -8140,11 +8170,12 @@@ end
  	bio_put(bio);
  }
  
- static int __btrfs_subio_endio_read(struct inode *inode,
- 				    struct btrfs_io_bio *io_bio, int err)
+ static blk_status_t __btrfs_subio_endio_read(struct inode *inode,
+ 		struct btrfs_io_bio *io_bio, blk_status_t err)
  {
  	struct btrfs_fs_info *fs_info;
 -	struct bio_vec *bvec;
 +	struct bio_vec bvec;
 +	struct bvec_iter iter;
  	struct btrfs_retry_complete done;
  	u64 start;
  	u64 offset = 0;
@@@ -8265,13 -8231,10 +8264,13 @@@ static void btrfs_endio_direct_read(str
  	struct inode *inode = dip->inode;
  	struct bio *dio_bio;
  	struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
- 	int err = bio->bi_error;
+ 	blk_status_t err = bio->bi_status;
  
 -	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED)
 +	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) {
  		err = btrfs_subio_endio_read(inode, io_bio, err);
 +		if (!err)
- 			bio->bi_error = 0;
++			bio->bi_status = 0;
 +	}
  
  	unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset,
  		      dip->logical_offset + dip->bytes - 1);
@@@ -8344,12 -8307,11 +8343,12 @@@ static void btrfs_endio_direct_write(st
  	bio_put(bio);
  }
  
- static int __btrfs_submit_bio_start_direct_io(void *private_data,
 -static blk_status_t __btrfs_submit_bio_start_direct_io(struct inode *inode,
++static blk_status_t __btrfs_submit_bio_start_direct_io(void *private_data,
  				    struct bio *bio, int mirror_num,
  				    unsigned long bio_flags, u64 offset)
  {
 +	struct inode *inode = private_data;
- 	int ret;
+ 	blk_status_t ret;
  	ret = btrfs_csum_one_bio(inode, bio, offset, 1);
  	BUG_ON(ret); /* -ENOMEM */
  	return 0;
@@@ -8395,7 -8357,17 +8394,7 @@@ out
  	bio_put(bio);
  }
  
- static inline int btrfs_lookup_and_bind_dio_csum(struct inode *inode,
 -static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
 -				       u64 first_sector, gfp_t gfp_flags)
 -{
 -	struct bio *bio;
 -	bio = btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 -	if (bio)
 -		bio_associate_current(bio);
 -	return bio;
 -}
 -
+ static inline blk_status_t btrfs_lookup_and_bind_dio_csum(struct inode *inode,
  						 struct btrfs_dio_private *dip,
  						 struct bio *bio,
  						 u64 file_offset)
@@@ -8675,10 -8672,10 +8674,10 @@@ free_ordered
  		 * Releases and cleans up our dio_bio, no need to bio_put()
  		 * nor bio_endio()/bio_io_error() against dio_bio.
  		 */
- 		dio_end_io(dio_bio, ret);
+ 		dio_end_io(dio_bio);
  	}
 -	if (io_bio)
 -		bio_put(io_bio);
 +	if (bio)
 +		bio_put(bio);
  	kfree(dip);
  }
  

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-13  3:50 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-13  3:50 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Josef Bacik, Liu Bo

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/inode.c

between commits:

  b6f68032afbe ("Btrfs: replace tree->mapping with tree->private_data")
  b7da91627746 ("Btrfs: use bio_clone_bioset_partial to simplify DIO submit")
  170a8768b6b7 ("Btrfs: unify naming of btrfs_io_bio")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/inode.c
index 4195079bfe1c,f942293dd7e7..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -1905,12 -1900,11 +1904,12 @@@ int btrfs_merge_bio_hook(struct page *p
   * At IO completion time the cums attached on the ordered extent record
   * are inserted into the btree
   */
- static int __btrfs_submit_bio_start(void *private_data, struct bio *bio,
- 				    int mirror_num, unsigned long bio_flags,
- 				    u64 bio_offset)
 -static blk_status_t __btrfs_submit_bio_start(struct inode *inode,
++static blk_status_t __btrfs_submit_bio_start(void *private_data,
+ 		struct bio *bio, int mirror_num, unsigned long bio_flags,
+ 		u64 bio_offset)
  {
 +	struct inode *inode = private_data;
- 	int ret = 0;
+ 	blk_status_t ret = 0;
  
  	ret = btrfs_csum_one_bio(inode, bio, 0, 0);
  	BUG_ON(ret); /* -ENOMEM */
@@@ -1925,13 -1919,12 +1924,13 @@@
   * At IO completion time the cums attached on the ordered extent record
   * are inserted into the btree
   */
- static int __btrfs_submit_bio_done(void *private_data, struct bio *bio,
- 			  int mirror_num, unsigned long bio_flags,
- 			  u64 bio_offset)
 -static blk_status_t __btrfs_submit_bio_done(struct inode *inode,
++static blk_status_t __btrfs_submit_bio_done(void *private_data,
+ 		struct bio *bio, int mirror_num, unsigned long bio_flags,
+ 		u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
- 	int ret;
+ 	blk_status_t ret;
  
  	ret = btrfs_map_bio(fs_info, bio, mirror_num, 1);
  	if (ret) {
@@@ -1945,11 -1938,10 +1944,11 @@@
   * extent_io.c submission hook. This does the right thing for csum calculation
   * on write, or reading the csums from the tree before a read
   */
- static int btrfs_submit_bio_hook(void *private_data, struct bio *bio,
- 				 int mirror_num, unsigned long bio_flags,
- 				 u64 bio_offset)
 -static blk_status_t btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
++static blk_status_t btrfs_submit_bio_hook(void *private_data, struct bio *bio,
+ 			  int mirror_num, unsigned long bio_flags,
+ 			  u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	struct btrfs_root *root = BTRFS_I(inode)->root;
  	enum btrfs_wq_endio_type metadata = BTRFS_WQ_ENDIO_DATA;
@@@ -8051,12 -8033,10 +8050,12 @@@ struct btrfs_retry_complete 
  static void btrfs_retry_endio_nocsum(struct bio *bio)
  {
  	struct btrfs_retry_complete *done = bio->bi_private;
 +	struct inode *inode = done->inode;
  	struct bio_vec *bvec;
 +	struct extent_io_tree *io_tree, *failure_tree;
  	int i;
  
- 	if (bio->bi_error)
+ 	if (bio->bi_status)
  		goto end;
  
  	ASSERT(bio->bi_vcnt == 1);
@@@ -8176,12 -8140,11 +8175,12 @@@ end
  	bio_put(bio);
  }
  
- static int __btrfs_subio_endio_read(struct inode *inode,
- 				    struct btrfs_io_bio *io_bio, int err)
+ static blk_status_t __btrfs_subio_endio_read(struct inode *inode,
+ 		struct btrfs_io_bio *io_bio, blk_status_t err)
  {
  	struct btrfs_fs_info *fs_info;
 -	struct bio_vec *bvec;
 +	struct bio_vec bvec;
 +	struct bvec_iter iter;
  	struct btrfs_retry_complete done;
  	u64 start;
  	u64 offset = 0;
@@@ -8271,13 -8231,10 +8270,13 @@@ static void btrfs_endio_direct_read(str
  	struct inode *inode = dip->inode;
  	struct bio *dio_bio;
  	struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
- 	int err = bio->bi_error;
+ 	blk_status_t err = bio->bi_status;
  
 -	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED)
 +	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) {
  		err = btrfs_subio_endio_read(inode, io_bio, err);
 +		if (!err)
 +			bio->bi_error = 0;
 +	}
  
  	unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset,
  		      dip->logical_offset + dip->bytes - 1);
@@@ -8350,12 -8307,11 +8349,12 @@@ static void btrfs_endio_direct_write(st
  	bio_put(bio);
  }
  
- static int __btrfs_submit_bio_start_direct_io(void *private_data,
 -static blk_status_t __btrfs_submit_bio_start_direct_io(struct inode *inode,
++static blk_status_t __btrfs_submit_bio_start_direct_io(void *private_data,
  				    struct bio *bio, int mirror_num,
  				    unsigned long bio_flags, u64 offset)
  {
 +	struct inode *inode = private_data;
- 	int ret;
+ 	blk_status_t ret;
  	ret = btrfs_csum_one_bio(inode, bio, offset, 1);
  	BUG_ON(ret); /* -ENOMEM */
  	return 0;
@@@ -8401,7 -8357,17 +8400,7 @@@ out
  	bio_put(bio);
  }
  
- static inline int btrfs_lookup_and_bind_dio_csum(struct inode *inode,
 -static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
 -				       u64 first_sector, gfp_t gfp_flags)
 -{
 -	struct bio *bio;
 -	bio = btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 -	if (bio)
 -		bio_associate_current(bio);
 -	return bio;
 -}
 -
+ static inline blk_status_t btrfs_lookup_and_bind_dio_csum(struct inode *inode,
  						 struct btrfs_dio_private *dip,
  						 struct bio *bio,
  						 u64 file_offset)
@@@ -8657,11 -8647,11 +8656,11 @@@ free_ordered
  	 * same as btrfs_endio_direct_[write|read] because we can't call these
  	 * callbacks - they require an allocated dip and a clone of dio_bio.
  	 */
 -	if (io_bio && dip) {
 -		io_bio->bi_status = BLK_STS_IOERR;
 -		bio_endio(io_bio);
 +	if (bio && dip) {
- 		bio->bi_error = -EIO;
++		bio->bi_status = BLK_STS_IOERR;
 +		bio_endio(bio);
  		/*
 -		 * The end io callbacks free our dip, do the final put on io_bio
 +		 * The end io callbacks free our dip, do the final put on bio
  		 * and all the cleanup and final put for dio_bio (through
  		 * dio_end_io()).
  		 */
@@@ -8682,10 -8672,10 +8681,10 @@@
  		 * Releases and cleans up our dio_bio, no need to bio_put()
  		 * nor bio_endio()/bio_io_error() against dio_bio.
  		 */
- 		dio_end_io(dio_bio, ret);
+ 		dio_end_io(dio_bio);
  	}
 -	if (io_bio)
 -		bio_put(io_bio);
 +	if (bio)
 +		bio_put(bio);
  	kfree(dip);
  }
  

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-13  3:34 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-13  3:34 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Josef Bacik

Hi Jens,

Today's linux-next merge of the block tree got conflicts in:

  fs/btrfs/extent_io.c
  fs/btrfs/extent_io.h

between commit:

  b6f68032afbe ("Btrfs: replace tree->mapping with tree->private_data")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index cb4754e57ace,8f66e55e7ba1..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -2369,9 -2397,9 +2369,10 @@@ static int bio_readpage_error(struct bi
  	struct io_failure_record *failrec;
  	struct inode *inode = page->mapping->host;
  	struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
 +	struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree;
  	struct bio *bio;
  	int read_mode = 0;
+ 	blk_status_t status;
  	int ret;
  
  	BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE);
@@@ -2404,11 -2432,12 +2405,12 @@@
  		"Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d",
  		read_mode, failrec->this_mirror, failrec->in_validation);
  
- 	ret = tree->ops->submit_bio_hook(tree->private_data, bio, failrec->this_mirror,
 -	status = tree->ops->submit_bio_hook(inode, bio, failrec->this_mirror,
++	status = tree->ops->submit_bio_hook(tree->private_data, bio, failrec->this_mirror,
  					 failrec->bio_flags, 0);
- 	if (ret) {
+ 	if (status) {
 -		free_io_failure(BTRFS_I(inode), failrec);
 +		free_io_failure(failure_tree, tree, failrec);
  		bio_put(bio);
+ 		ret = blk_status_to_errno(status);
  	}
  
  	return ret;
@@@ -2509,9 -2539,9 +2512,9 @@@ endio_readpage_release_extent(struct ex
  static void end_bio_extent_readpage(struct bio *bio)
  {
  	struct bio_vec *bvec;
- 	int uptodate = !bio->bi_error;
+ 	int uptodate = !bio->bi_status;
  	struct btrfs_io_bio *io_bio = btrfs_io_bio(bio);
 -	struct extent_io_tree *tree;
 +	struct extent_io_tree *tree, *failure_tree;
  	u64 offset = 0;
  	u64 start;
  	u64 end;
@@@ -2529,10 -2559,9 +2532,10 @@@
  
  		btrfs_debug(fs_info,
  			"end_bio_extent_readpage: bi_sector=%llu, err=%d, mirror=%u",
- 			(u64)bio->bi_iter.bi_sector, bio->bi_error,
+ 			(u64)bio->bi_iter.bi_sector, bio->bi_status,
  			io_bio->mirror_num);
  		tree = &BTRFS_I(inode)->io_tree;
 +		failure_tree = &BTRFS_I(inode)->io_failure_tree;
  
  		/* We always issue full-page reads, but if some block
  		 * in a page fails to read, blk_update_request() will
diff --cc fs/btrfs/extent_io.h
index 0f3601712a0a,487ca0207cb6..000000000000
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@@ -92,9 -92,9 +92,9 @@@ struct btrfs_inode
  struct btrfs_io_bio;
  struct io_failure_record;
  
- typedef	int (extent_submit_bio_hook_t)(void *private_data, struct bio *bio,
- 				       int mirror_num, unsigned long bio_flags,
- 				       u64 bio_offset);
 -typedef	blk_status_t (extent_submit_bio_hook_t)(struct inode *inode,
++typedef	blk_status_t (extent_submit_bio_hook_t)(void *private_data,
+ 		struct bio *bio, int mirror_num, unsigned long bio_flags,
+ 		u64 bio_offset);
  struct extent_io_ops {
  	/*
  	 * The following callbacks must be allways defined, the function

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2017-06-13  3:27 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2017-06-13  3:27 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Josef Bacik

Hi Jens,

Today's linux-next merge of the block tree got conflicts in:

  fs/btrfs/disk-io.c
  fs/btrfs/disk-io.h

between commits:

  b6f68032afbe ("Btrfs: replace tree->mapping with tree->private_data")
  9035b5dbc576 ("btrfs: btrfs_io_bio_alloc never fails, skip error handling")

from the btrfs-kdave tree and commit:

  4e4cbee93d56 ("block: switch bios to blk_status_t")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index 9f2ffe2c6afb,6036d15b47b8..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -87,8 -87,9 +87,8 @@@ struct btrfs_end_io_wq 
  	bio_end_io_t *end_io;
  	void *private;
  	struct btrfs_fs_info *info;
- 	int error;
+ 	blk_status_t status;
  	enum btrfs_wq_endio_type metadata;
 -	struct list_head list;
  	struct btrfs_work work;
  };
  
@@@ -867,10 -868,10 +867,10 @@@ unsigned long btrfs_async_submit_limit(
  static void run_one_async_start(struct btrfs_work *work)
  {
  	struct async_submit_bio *async;
- 	int ret;
+ 	blk_status_t ret;
  
  	async = container_of(work, struct  async_submit_bio, work);
 -	ret = async->submit_bio_start(async->inode, async->bio,
 +	ret = async->submit_bio_start(async->private_data, async->bio,
  				      async->mirror_num, async->bio_flags,
  				      async->bio_offset);
  	if (ret)
@@@ -915,20 -916,19 +915,20 @@@ static void run_one_async_free(struct b
  	kfree(async);
  }
  
- int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
- 			int mirror_num, unsigned long bio_flags,
- 			u64 bio_offset, void *private_data,
- 			extent_submit_bio_hook_t *submit_bio_start,
- 			extent_submit_bio_hook_t *submit_bio_done)
 -blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info,
 -		struct inode *inode, struct bio *bio, int mirror_num,
 -		unsigned long bio_flags, u64 bio_offset,
 -		extent_submit_bio_hook_t *submit_bio_start,
 -		extent_submit_bio_hook_t *submit_bio_done)
++blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
++				 int mirror_num, unsigned long bio_flags,
++				 u64 bio_offset, void *private_data,
++				 extent_submit_bio_hook_t *submit_bio_start,
++				 extent_submit_bio_hook_t *submit_bio_done)
  {
  	struct async_submit_bio *async;
  
  	async = kmalloc(sizeof(*async), GFP_NOFS);
  	if (!async)
- 		return -ENOMEM;
+ 		return BLK_STS_RESOURCE;
  
 -	async->inode = inode;
 +	async->private_data = private_data;
 +	async->fs_info = fs_info;
  	async->bio = bio;
  	async->mirror_num = mirror_num;
  	async->submit_bio_start = submit_bio_start;
@@@ -971,12 -971,12 +971,14 @@@ static blk_status_t btree_csum_one_bio(
  			break;
  	}
  
- 	return ret;
+ 	return errno_to_blk_status(ret);
  }
  
- static int __btree_submit_bio_start(void *private_data, struct bio *bio,
- 				    int mirror_num, unsigned long bio_flags,
- 				    u64 bio_offset)
 -static blk_status_t __btree_submit_bio_start(struct inode *inode,
 -		struct bio *bio, int mirror_num, unsigned long bio_flags,
 -		u64 bio_offset)
++static blk_status_t __btree_submit_bio_start(void *private_data,
++					     struct bio *bio,
++					     int mirror_num,
++					     unsigned long bio_flags,
++					     u64 bio_offset)
  {
  	/*
  	 * when we're called for a write, we're already in the async
@@@ -985,12 -985,11 +987,12 @@@
  	return btree_csum_one_bio(bio);
  }
  
- static int __btree_submit_bio_done(void *private_data, struct bio *bio,
- 				 int mirror_num, unsigned long bio_flags,
- 				 u64 bio_offset)
 -static blk_status_t __btree_submit_bio_done(struct inode *inode,
++static blk_status_t __btree_submit_bio_done(void *private_data,
+ 		struct bio *bio, int mirror_num, unsigned long bio_flags,
+ 		u64 bio_offset)
  {
 +	struct inode *inode = private_data;
- 	int ret;
+ 	blk_status_t ret;
  
  	/*
  	 * when we're called for a write, we're already in the async
@@@ -1015,14 -1014,13 +1017,14 @@@ static int check_async_write(unsigned l
  	return 1;
  }
  
- static int btree_submit_bio_hook(void *private_data, struct bio *bio,
 -static blk_status_t btree_submit_bio_hook(struct inode *inode, struct bio *bio,
++static blk_status_t btree_submit_bio_hook(void *private_data, struct bio *bio,
  				 int mirror_num, unsigned long bio_flags,
  				 u64 bio_offset)
  {
 +	struct inode *inode = private_data;
  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	int async = check_async_write(bio_flags);
- 	int ret;
+ 	blk_status_t ret;
  
  	if (bio_op(bio) != REQ_OP_WRITE) {
  		/*
diff --cc fs/btrfs/disk-io.h
index 4654d129aa76,c581927555f3..000000000000
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@@ -118,16 -118,16 +118,16 @@@ int btrfs_buffer_uptodate(struct extent
  int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid);
  u32 btrfs_csum_data(const char *data, u32 seed, size_t len);
  void btrfs_csum_final(u32 crc, u8 *result);
- int btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
+ blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
  			enum btrfs_wq_endio_type metadata);
- int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
 -blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info,
 -		struct inode *inode, struct bio *bio, int mirror_num,
 -		unsigned long bio_flags, u64 bio_offset,
 -		extent_submit_bio_hook_t *submit_bio_start,
 -		extent_submit_bio_hook_t *submit_bio_done);
++blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
 +			int mirror_num, unsigned long bio_flags,
 +			u64 bio_offset, void *private_data,
 +			extent_submit_bio_hook_t *submit_bio_start,
 +			extent_submit_bio_hook_t *submit_bio_done);
  unsigned long btrfs_async_submit_limit(struct btrfs_fs_info *info);
  int btrfs_write_tree_block(struct extent_buffer *buf);
 -int btrfs_wait_tree_block_writeback(struct extent_buffer *buf);
 +void btrfs_wait_tree_block_writeback(struct extent_buffer *buf);
  int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
  			     struct btrfs_fs_info *fs_info);
  int btrfs_add_log_tree(struct btrfs_trans_handle *trans,

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: linux-next: manual merge of the block tree with the btrfs-kdave tree
  2016-11-17 13:23   ` Christoph Hellwig
@ 2016-11-18 17:47     ` David Sterba
  0 siblings, 0 replies; 18+ messages in thread
From: David Sterba @ 2016-11-18 17:47 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jens Axboe, Stephen Rothwell, linux-next, linux-kernel

On Thu, Nov 17, 2016 at 02:23:01PM +0100, Christoph Hellwig wrote:
> On Wed, Nov 16, 2016 at 07:49:29PM -0700, Jens Axboe wrote:
> > doesn't look correct, if bio_readpage_error() is called from the 
> > ->bi_end_io() handler. bi_size is generally zeroed at that time.
> 
> At least some of these bios are magic btrfs-internal ones that never
> reach the block layer.  But I don't think all are, and both the new
> code and one of the old cases are broken.  David, can you drop
> this one patch for now, and I'll restart the discussion on the
> failfast behavior on the btrfs list?

Ok, updated in today's for-next snapshot.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: linux-next: manual merge of the block tree with the btrfs-kdave tree
  2016-11-17  2:49 ` Jens Axboe
@ 2016-11-17 13:23   ` Christoph Hellwig
  2016-11-18 17:47     ` David Sterba
  0 siblings, 1 reply; 18+ messages in thread
From: Christoph Hellwig @ 2016-11-17 13:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Stephen Rothwell, David Sterba, linux-next, linux-kernel,
	Christoph Hellwig

On Wed, Nov 16, 2016 at 07:49:29PM -0700, Jens Axboe wrote:
> doesn't look correct, if bio_readpage_error() is called from the 
> ->bi_end_io() handler. bi_size is generally zeroed at that time.

At least some of these bios are magic btrfs-internal ones that never
reach the block layer.  But I don't think all are, and both the new
code and one of the old cases are broken.  David, can you drop
this one patch for now, and I'll restart the discussion on the
failfast behavior on the btrfs list?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: linux-next: manual merge of the block tree with the btrfs-kdave tree
  2016-11-17  2:01 Stephen Rothwell
@ 2016-11-17  2:49 ` Jens Axboe
  2016-11-17 13:23   ` Christoph Hellwig
  0 siblings, 1 reply; 18+ messages in thread
From: Jens Axboe @ 2016-11-17  2:49 UTC (permalink / raw)
  To: Stephen Rothwell, David Sterba
  Cc: linux-next, linux-kernel, Christoph Hellwig

On 11/16/2016 07:01 PM, Stephen Rothwell wrote:
> Hi Jens,
>
> Today's linux-next merge of the block tree got conflicts in:
>
>   fs/btrfs/extent_io.c
>   fs/btrfs/inode.c
>
> between commit:
>
>   01a1400f8545 ("btrfs: only check bio size to see if a repair bio should have the failfast flag")
>
> from the btrfs-kdave tree and commit:
>
>   70fd76140a6c ("block,fs: use REQ_* flags directly")
>
> from the block tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>

I don't have the full context here, but this:

diff --cc fs/btrfs/extent_io.c
index 5694d60adad9,1e67723c27a1..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -2403,10 -2403,8 +2403,8 @@@ static int bio_readpage_error(struct bi
   		return -EIO;
   	}

  -	if (failed_bio->bi_vcnt > 1)
  +	if (failed_bio->bi_iter.bi_size > BTRFS_I(inode)->root->sectorsize)
- 		read_mode = READ_SYNC | REQ_FAILFAST_DEV;
- 	else
- 		read_mode = READ_SYNC;
+ 		read_mode |= REQ_FAILFAST_DEV;

   	phy_offset >>= inode->i_sb->s_blocksize_bits;
   	bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page,

doesn't look correct, if bio_readpage_error() is called from the 
->bi_end_io() handler. bi_size is generally zeroed at that time.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-11-17  2:01 Stephen Rothwell
  2016-11-17  2:49 ` Jens Axboe
  0 siblings, 1 reply; 18+ messages in thread
From: Stephen Rothwell @ 2016-11-17  2:01 UTC (permalink / raw)
  To: Jens Axboe, David Sterba; +Cc: linux-next, linux-kernel, Christoph Hellwig

Hi Jens,

Today's linux-next merge of the block tree got conflicts in:

  fs/btrfs/extent_io.c
  fs/btrfs/inode.c

between commit:

  01a1400f8545 ("btrfs: only check bio size to see if a repair bio should have the failfast flag")

from the btrfs-kdave tree and commit:

  70fd76140a6c ("block,fs: use REQ_* flags directly")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index 5694d60adad9,1e67723c27a1..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -2403,10 -2403,8 +2403,8 @@@ static int bio_readpage_error(struct bi
  		return -EIO;
  	}
  
 -	if (failed_bio->bi_vcnt > 1)
 +	if (failed_bio->bi_iter.bi_size > BTRFS_I(inode)->root->sectorsize)
- 		read_mode = READ_SYNC | REQ_FAILFAST_DEV;
- 	else
- 		read_mode = READ_SYNC;
+ 		read_mode |= REQ_FAILFAST_DEV;
  
  	phy_offset >>= inode->i_sb->s_blocksize_bits;
  	bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page,
diff --cc fs/btrfs/inode.c
index 7e8603c74f43,a4c879671b9d..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7924,10 -7933,10 +7924,8 @@@ static int dio_read_error(struct inode 
  		return -EIO;
  	}
  
 -	if ((failed_bio->bi_vcnt > 1)
 -		|| (failed_bio->bi_io_vec->bv_len
 -			> BTRFS_I(inode)->root->sectorsize))
 +	if (failed_bio->bi_iter.bi_size > BTRFS_I(inode)->root->sectorsize)
- 		read_mode = READ_SYNC | REQ_FAILFAST_DEV;
- 	else
- 		read_mode = READ_SYNC;
+ 		read_mode |= REQ_FAILFAST_DEV;
  
  	isector = start - btrfs_io_bio(failed_bio)->logical;
  	isector >>= inode->i_sb->s_blocksize_bits;

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  4:03 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  4:03 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: linux-next, linux-kernel, Jeff Mahoney, Mike Christie

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/volumes.h

between commit:

  26112f7f4726 ("btrfs: take an fs_info parameter directly when the root is not used otherwise")

from the btrfs-kdave tree and commit:

  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/volumes.h
index dc219e259281,6613e6335ca2..000000000000
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@@ -384,13 -385,13 +384,13 @@@ int btrfs_map_sblock(struct btrfs_fs_in
  int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
  		     u64 chunk_start, u64 physical, u64 devid,
  		     u64 **logical, int *naddrs, int *stripe_len);
 -int btrfs_read_sys_array(struct btrfs_root *root);
 -int btrfs_read_chunk_tree(struct btrfs_root *root);
 +int btrfs_read_sys_array(struct btrfs_fs_info *fs_info);
 +int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info);
  int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 -		      struct btrfs_root *extent_root, u64 type);
 +		      struct btrfs_fs_info *fs_info, u64 type);
  void btrfs_mapping_init(struct btrfs_mapping_tree *tree);
  void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
- int btrfs_map_bio(struct btrfs_fs_info *fs_info, int rw, struct bio *bio,
 -int btrfs_map_bio(struct btrfs_root *root, struct bio *bio,
++int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
  		  int mirror_num, int async_submit);
  int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
  		       fmode_t flags, void *holder);

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  4:00 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  4:00 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: linux-next, linux-kernel, Jeff Mahoney, Mike Christie

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/volumes.c

between commit:

  26112f7f4726 ("btrfs: take an fs_info parameter directly when the root is not used otherwise")

from the btrfs-kdave tree and commit:

  4e49ea4a3d27 ("block/fs/drivers: remove rw argument from submit_bio")
  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/volumes.c
index 64d2557fe7fc,14b2d19c842c..000000000000
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@@ -5984,10 -5999,10 +5989,10 @@@ static void btrfs_end_bio(struct bio *b
   * This will add one bio to the pending list for a device and make sure
   * the work struct is scheduled.
   */
 -static noinline void btrfs_schedule_bio(struct btrfs_root *root,
 -					struct btrfs_device *device,
 +static noinline void btrfs_schedule_bio(struct btrfs_device *device,
- 					int rw, struct bio *bio)
+ 					struct bio *bio)
  {
 +	struct btrfs_fs_info *fs_info = device->fs_info;
  	int should_queue = 1;
  	struct btrfs_pending_bios *pending_bios;
  
@@@ -6010,10 -6025,9 +6015,9 @@@
  	 * made progress against dirty pages when we've really just put it
  	 * on a queue for later
  	 */
 -	atomic_inc(&root->fs_info->nr_async_bios);
 +	atomic_inc(&fs_info->nr_async_bios);
  	WARN_ON(bio->bi_next);
  	bio->bi_next = NULL;
- 	bio->bi_rw |= rw;
  
  	spin_lock(&device->io_lock);
  	if (bio->bi_rw & REQ_SYNC)
@@@ -6033,14 -6047,15 +6037,14 @@@
  	spin_unlock(&device->io_lock);
  
  	if (should_queue)
 -		btrfs_queue_work(root->fs_info->submit_workers,
 -				 &device->work);
 +		btrfs_queue_work(fs_info->submit_workers, &device->work);
  }
  
 -static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio,
 -			      struct bio *bio, u64 physical, int dev_nr,
 -			      int async)
 +static void submit_stripe_bio(struct btrfs_bio *bbio, struct bio *bio,
- 			      u64 physical, int dev_nr, int rw, int async)
++			      u64 physical, int dev_nr, int async)
  {
  	struct btrfs_device *dev = bbio->stripes[dev_nr].dev;
 +	struct btrfs_fs_info *fs_info = bbio->fs_info;
  
  	bio->bi_private = bbio;
  	btrfs_io_bio(bio)->stripe_index = dev_nr;
@@@ -6061,12 -6076,12 +6065,12 @@@
  #endif
  	bio->bi_bdev = dev->bdev;
  
 -	btrfs_bio_counter_inc_noblocked(root->fs_info);
 +	btrfs_bio_counter_inc_noblocked(fs_info);
  
  	if (async)
- 		btrfs_schedule_bio(dev, rw, bio);
 -		btrfs_schedule_bio(root, dev, bio);
++		btrfs_schedule_bio(dev, bio);
  	else
- 		btrfsic_submit_bio(rw, bio);
+ 		btrfsic_submit_bio(bio);
  }
  
  static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical)
@@@ -6083,7 -6098,7 +6087,7 @@@
  	}
  }
  
- int btrfs_map_bio(struct btrfs_fs_info *fs_info, int rw, struct bio *bio,
 -int btrfs_map_bio(struct btrfs_root *root, struct bio *bio,
++int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
  		  int mirror_num, int async_submit)
  {
  	struct btrfs_device *dev;
@@@ -6099,11 -6114,11 +6103,11 @@@
  	length = bio->bi_iter.bi_size;
  	map_length = length;
  
 -	btrfs_bio_counter_inc_blocked(root->fs_info);
 -	ret = __btrfs_map_block(root->fs_info, bio_op(bio), logical,
 -				&map_length, &bbio, mirror_num, 1);
 +	btrfs_bio_counter_inc_blocked(fs_info);
- 	ret = __btrfs_map_block(fs_info, rw, logical, &map_length, &bbio,
- 				mirror_num, 1);
++	ret = __btrfs_map_block(fs_info, bio_op(bio), logical, &map_length,
++				&bbio, mirror_num, 1);
  	if (ret) {
 -		btrfs_bio_counter_dec(root->fs_info);
 +		btrfs_bio_counter_dec(fs_info);
  		return ret;
  	}
  
@@@ -6115,18 -6130,17 +6119,18 @@@
  	atomic_set(&bbio->stripes_pending, bbio->num_stripes);
  
  	if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) &&
- 	    ((rw & WRITE) || (mirror_num > 1))) {
+ 	    ((bio_op(bio) == REQ_OP_WRITE) || (mirror_num > 1))) {
  		/* In this case, map_length has been set to the length of
  		   a single stripe; not the whole write */
- 		if (rw & WRITE) {
+ 		if (bio_op(bio) == REQ_OP_WRITE) {
 -			ret = raid56_parity_write(root, bio, bbio, map_length);
 +			ret = raid56_parity_write(fs_info, bio, bbio,
 +						  map_length);
  		} else {
 -			ret = raid56_parity_recover(root, bio, bbio, map_length,
 -						    mirror_num, 1);
 +			ret = raid56_parity_recover(fs_info, bio, bbio,
 +						    map_length, mirror_num, 1);
  		}
  
 -		btrfs_bio_counter_dec(root->fs_info);
 +		btrfs_bio_counter_dec(fs_info);
  		return ret;
  	}
  
@@@ -6150,10 -6164,11 +6155,10 @@@
  		} else
  			bio = first_bio;
  
 -		submit_stripe_bio(root, bbio, bio,
 -				  bbio->stripes[dev_nr].physical, dev_nr,
 -				  async_submit);
 +		submit_stripe_bio(bbio, bio, bbio->stripes[dev_nr].physical,
- 				  dev_nr, rw, async_submit);
++				  dev_nr, async_submit);
  	}
 -	btrfs_bio_counter_dec(root->fs_info);
 +	btrfs_bio_counter_dec(fs_info);
  	return 0;
  }
  

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  3:49 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  3:49 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: linux-next, linux-kernel, Mike Christie, Jeff Mahoney, Liu Bo

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/inode.c

between commit:

  b286384aac32 ("btrfs: root->fs_info cleanup, add fs_info convenience variables")
  26112f7f4726 ("btrfs: take an fs_info parameter directly when the root is not used otherwise")
  712518c27ed2 ("Btrfs: cleanup BUG_ON in merge_bio")

from the btrfs-kdave tree and commit:

  37226b2111b0 ("btrfs: use bio op accessors")
  b3d3fa519905 ("btrfs: update __btrfs_map_block for REQ_OP transition")
  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/inode.c
index 31b1195eb3d4,1323e4faa44c..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -1835,12 -1822,8 +1835,12 @@@ static void btrfs_clear_bit_hook(struc
  /*
   * extent_io.c merge_bio_hook, this must check the chunk tree to make sure
   * we don't create bios that span stripes or chunks
 + *
 + * return 1 if page cannot be merged to bio
 + * return 0 if page can be merged to bio
 + * return error otherwise
   */
- int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset,
+ int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
  			 size_t size, struct bio *bio,
  			 unsigned long bio_flags)
  {
@@@ -1856,9 -1838,10 +1856,10 @@@
  
  	length = bio->bi_iter.bi_size;
  	map_length = length;
- 	ret = btrfs_map_block(fs_info, rw, logical, &map_length, NULL, 0);
 -	ret = btrfs_map_block(root->fs_info, bio_op(bio), logical,
 -			      &map_length, NULL, 0);
 -	/* Will always return 0 with map_multi == NULL */
 -	BUG_ON(ret < 0);
++	ret = btrfs_map_block(fs_info, bio_op(bio), logical, &map_length,
++			      NULL, 0);
 +	if (ret < 0)
 +		return ret;
  	if (map_length < length + size)
  		return 1;
  	return 0;
@@@ -1872,14 -1855,14 +1873,13 @@@
   * At IO completion time the cums attached on the ordered extent record
   * are inserted into the btree
   */
- static int __btrfs_submit_bio_start(struct inode *inode, int rw,
- 				    struct bio *bio, int mirror_num,
- 				    unsigned long bio_flags,
+ static int __btrfs_submit_bio_start(struct inode *inode, struct bio *bio,
+ 				    int mirror_num, unsigned long bio_flags,
  				    u64 bio_offset)
  {
 -	struct btrfs_root *root = BTRFS_I(inode)->root;
  	int ret = 0;
  
 -	ret = btrfs_csum_one_bio(root, inode, bio, 0, 0);
 +	ret = btrfs_csum_one_bio(inode, bio, 0, 0);
  	BUG_ON(ret); /* -ENOMEM */
  	return 0;
  }
@@@ -1896,10 -1879,10 +1896,10 @@@ static int __btrfs_submit_bio_done(stru
  			  int mirror_num, unsigned long bio_flags,
  			  u64 bio_offset)
  {
 -	struct btrfs_root *root = BTRFS_I(inode)->root;
 +	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	int ret;
  
- 	ret = btrfs_map_bio(fs_info, rw, bio, mirror_num, 1);
 -	ret = btrfs_map_bio(root, bio, mirror_num, 1);
++	ret = btrfs_map_bio(fs_info, bio, mirror_num, 1);
  	if (ret) {
  		bio->bi_error = ret;
  		bio_endio(bio);
@@@ -1927,8 -1909,8 +1927,8 @@@ static int btrfs_submit_bio_hook(struc
  	if (btrfs_is_free_space_inode(inode))
  		metadata = BTRFS_WQ_ENDIO_FREE_SPACE;
  
- 	if (!(rw & REQ_WRITE)) {
+ 	if (bio_op(bio) != REQ_OP_WRITE) {
 -		ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata);
 +		ret = btrfs_bio_wq_end_io(fs_info, bio, metadata);
  		if (ret)
  			goto out;
  
@@@ -1948,7 -1930,8 +1948,7 @@@
  		if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
  			goto mapit;
  		/* we're doing a write, do the async checksumming */
- 		ret = btrfs_wq_submit_bio(fs_info, inode, rw, bio, mirror_num,
 -		ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info,
 -				   inode, bio, mirror_num,
++		ret = btrfs_wq_submit_bio(fs_info, inode, bio, mirror_num,
  				   bio_flags, bio_offset,
  				   __btrfs_submit_bio_start,
  				   __btrfs_submit_bio_done);
@@@ -1960,7 -1943,7 +1960,7 @@@
  	}
  
  mapit:
- 	ret = btrfs_map_bio(fs_info, rw, bio, mirror_num, 0);
 -	ret = btrfs_map_bio(root, bio, mirror_num, 0);
++	ret = btrfs_map_bio(fs_info, bio, mirror_num, 0);
  
  out:
  	if (ret < 0) {
@@@ -7865,12 -7777,12 +7865,12 @@@ err
  }
  
  static inline int submit_dio_repair_bio(struct inode *inode, struct bio *bio,
- 					int rw, int mirror_num)
+ 					int mirror_num)
  {
 -	struct btrfs_root *root = BTRFS_I(inode)->root;
 +	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	int ret;
  
- 	BUG_ON(rw & REQ_WRITE);
+ 	BUG_ON(bio_op(bio) == REQ_OP_WRITE);
  
  	bio_get(bio);
  
@@@ -7878,7 -7791,7 +7878,7 @@@
  	if (ret)
  		goto err;
  
- 	ret = btrfs_map_bio(fs_info, rw, bio, mirror_num, 0);
 -	ret = btrfs_map_bio(root, bio, mirror_num, 0);
++	ret = btrfs_map_bio(fs_info, bio, mirror_num, 0);
  err:
  	bio_put(bio);
  	return ret;
@@@ -8343,12 -8259,12 +8343,12 @@@ static inline int btrfs_lookup_and_bind
  }
  
  static inline int __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode,
- 					 int rw, u64 file_offset, int skip_sum,
+ 					 u64 file_offset, int skip_sum,
  					 int async_submit)
  {
 +	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
  	struct btrfs_dio_private *dip = bio->bi_private;
- 	int write = rw & REQ_WRITE;
+ 	bool write = bio_op(bio) == REQ_OP_WRITE;
 -	struct btrfs_root *root = BTRFS_I(inode)->root;
  	int ret;
  
  	if (async_submit)
@@@ -8366,10 -8283,10 +8366,10 @@@
  		goto map;
  
  	if (write && async_submit) {
- 		ret = btrfs_wq_submit_bio(fs_info, inode, rw, bio, 0, 0,
 -		ret = btrfs_wq_submit_bio(root->fs_info,
 -				   inode, bio, 0, 0, file_offset,
 -				   __btrfs_submit_bio_start_direct_io,
 -				   __btrfs_submit_bio_done);
++		ret = btrfs_wq_submit_bio(fs_info, inode, bio, 0, 0,
 +					  file_offset,
 +					  __btrfs_submit_bio_start_direct_io,
 +					  __btrfs_submit_bio_done);
  		goto err;
  	} else if (write) {
  		/*
@@@ -8386,7 -8303,7 +8386,7 @@@
  			goto err;
  	}
  map:
- 	ret = btrfs_map_bio(fs_info, rw, bio, 0, async_submit);
 -	ret = btrfs_map_bio(root, bio, 0, async_submit);
++	ret = btrfs_map_bio(fs_info, bio, 0, async_submit);
  err:
  	bio_put(bio);
  	return ret;
@@@ -8412,8 -8328,8 +8412,8 @@@ static int btrfs_submit_direct_hook(str
  	int i;
  
  	map_length = orig_bio->bi_iter.bi_size;
- 	ret = btrfs_map_block(fs_info, rw, start_sector << 9, &map_length,
- 			      NULL, 0);
 -	ret = btrfs_map_block(root->fs_info, bio_op(orig_bio),
++	ret = btrfs_map_block(fs_info, bio_op(orig_bio),
+ 			      start_sector << 9, &map_length, NULL, 0);
  	if (ret)
  		return -EIO;
  
@@@ -8475,7 -8393,8 +8477,8 @@@ next_block
  			btrfs_io_bio(bio)->logical = file_offset;
  
  			map_length = orig_bio->bi_iter.bi_size;
- 			ret = btrfs_map_block(fs_info, rw, start_sector << 9,
 -			ret = btrfs_map_block(root->fs_info, bio_op(orig_bio),
++			ret = btrfs_map_block(fs_info, bio_op(orig_bio),
+ 					      start_sector << 9,
  					      &map_length, NULL, 0);
  			if (ret) {
  				bio_put(bio);

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  3:31 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  3:31 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: linux-next, linux-kernel, Jeff Mahoney, Mike Christie

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/extent-tree.c

between commit:

  b286384aac32 ("btrfs: root->fs_info cleanup, add fs_info convenience variables")
[again, no commiter Signed-off-by]

from the btrfs-kdave tree and commit:

  b3d3fa519905 ("btrfs: update __btrfs_map_block for REQ_OP transition")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent-tree.c
index dd7e454d1cf5,5796c4a9eec6..000000000000
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@@ -2047,10 -2046,10 +2047,10 @@@ int btrfs_discard_extent(struct btrfs_f
  	 * Avoid races with device replace and make sure our bbio has devices
  	 * associated to its stripes that don't go away while we are discarding.
  	 */
 -	btrfs_bio_counter_inc_blocked(root->fs_info);
 +	btrfs_bio_counter_inc_blocked(fs_info);
  	/* Tell the block device(s) that the sectors can be discarded */
- 	ret = btrfs_map_block(fs_info, REQ_DISCARD, bytenr, &num_bytes,
 -	ret = btrfs_map_block(root->fs_info, REQ_OP_DISCARD,
 -			      bytenr, &num_bytes, &bbio, 0);
++	ret = btrfs_map_block(fs_info, REQ_OP_DISCARD, bytenr, &num_bytes,
 +			      &bbio, 0);
  	/* Error condition is -ENOMEM */
  	if (!ret) {
  		struct btrfs_bio_stripe *stripe = bbio->stripes;

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  3:27 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  3:27 UTC (permalink / raw)
  To: Jens Axboe, David Sterba; +Cc: linux-next, linux-kernel, Jeff Mahoney

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/disk-io.c

between commit:

  b286384aac32 ("btrfs: root->fs_info cleanup, add fs_info convenience variables")
  26112f7f4726 ("btrfs: take an fs_info parameter directly when the root is not used otherwise")

from the btrfs-kdave tree and commit:

  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index 9d778665c9eb,e80ef6eb17e6..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -926,7 -921,7 +922,7 @@@ static int __btree_submit_bio_done(stru
  	 * when we're called for a write, we're already in the async
  	 * submission context.  Just jump into btrfs_map_bio
  	 */
- 	ret = btrfs_map_bio(btrfs_sb(inode->i_sb), rw, bio, mirror_num, 1);
 -	ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 1);
++	ret = btrfs_map_bio(btrfs_sb(inode->i_sb), bio, mirror_num, 1);
  	if (ret) {
  		bio->bi_error = ret;
  		bio_endio(bio);
@@@ -958,23 -952,24 +954,23 @@@ static int btree_submit_bio_hook(struc
  		 * called for a read, do the setup so that checksum validation
  		 * can happen in the async kernel threads
  		 */
 -		ret = btrfs_bio_wq_end_io(BTRFS_I(inode)->root->fs_info,
 -					  bio, BTRFS_WQ_ENDIO_METADATA);
 +		ret = btrfs_bio_wq_end_io(fs_info, bio,
 +					  BTRFS_WQ_ENDIO_METADATA);
  		if (ret)
  			goto out_w_error;
- 		ret = btrfs_map_bio(fs_info, rw, bio, mirror_num, 0);
 -		ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 0);
++		ret = btrfs_map_bio(fs_info, bio, mirror_num, 0);
  	} else if (!async) {
  		ret = btree_csum_one_bio(bio);
  		if (ret)
  			goto out_w_error;
- 		ret = btrfs_map_bio(fs_info, rw, bio, mirror_num, 0);
 -		ret = btrfs_map_bio(BTRFS_I(inode)->root, bio, mirror_num, 0);
++		ret = btrfs_map_bio(fs_info, bio, mirror_num, 0);
  	} else {
  		/*
  		 * kthread helpers are used to submit writes so that
  		 * checksumming can happen in parallel across all CPUs
  		 */
- 		ret = btrfs_wq_submit_bio(fs_info, inode, rw, bio,
 -		ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info,
 -					  inode, bio, mirror_num, 0,
 -					  bio_offset,
++		ret = btrfs_wq_submit_bio(fs_info, inode, bio,
 +					  mirror_num, 0, bio_offset,
  					  __btree_submit_bio_start,
  					  __btree_submit_bio_done);
  	}

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-07-08  3:26 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-07-08  3:26 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: linux-next, linux-kernel, Jeff Mahoney, Liu Bo, Mike Christie

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/compression.c

between commit:

  26112f7f4726 ("btrfs: take an fs_info parameter directly when the root is not used otherwise")
[This commit has no Signed-off-by from its committer :-(]
  d42b410c1511 ("Btrfs: fix BUG_ON in btrfs_submit_compressed_write")

from the btrfs-kdave tree and commit:

  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/compression.c
index 36ef2e8f3c87,cefedabf0a92..000000000000
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@@ -400,11 -402,8 +401,11 @@@ int btrfs_submit_compressed_write(struc
  				BUG_ON(ret); /* -ENOMEM */
  			}
  
- 			ret = btrfs_map_bio(fs_info, WRITE, bio, 0, 1);
 -			ret = btrfs_map_bio(root, bio, 0, 1);
 -			BUG_ON(ret); /* -ENOMEM */
++			ret = btrfs_map_bio(fs_info, bio, 0, 1);
 +			if (ret) {
 +				bio->bi_error = ret;
 +				bio_endio(bio);
 +			}
  
  			bio_put(bio);
  
@@@ -433,11 -433,8 +435,11 @@@
  		BUG_ON(ret); /* -ENOMEM */
  	}
  
- 	ret = btrfs_map_bio(fs_info, WRITE, bio, 0, 1);
 -	ret = btrfs_map_bio(root, bio, 0, 1);
 -	BUG_ON(ret); /* -ENOMEM */
++	ret = btrfs_map_bio(fs_info, bio, 0, 1);
 +	if (ret) {
 +		bio->bi_error = ret;
 +		bio_endio(bio);
 +	}
  
  	bio_put(bio);
  	return 0;
@@@ -690,10 -688,9 +693,9 @@@ int btrfs_submit_compressed_read(struc
  				BUG_ON(ret); /* -ENOMEM */
  			}
  			sums += DIV_ROUND_UP(comp_bio->bi_iter.bi_size,
 -					     root->sectorsize);
 +					     fs_info->sectorsize);
  
- 			ret = btrfs_map_bio(fs_info, READ, comp_bio,
- 					    mirror_num, 0);
 -			ret = btrfs_map_bio(root, comp_bio, mirror_num, 0);
++			ret = btrfs_map_bio(fs_info, comp_bio, mirror_num, 0);
  			if (ret) {
  				bio->bi_error = ret;
  				bio_endio(comp_bio);
@@@ -721,7 -720,7 +724,7 @@@
  		BUG_ON(ret); /* -ENOMEM */
  	}
  
- 	ret = btrfs_map_bio(fs_info, READ, comp_bio, mirror_num, 0);
 -	ret = btrfs_map_bio(root, comp_bio, mirror_num, 0);
++	ret = btrfs_map_bio(fs_info, comp_bio, mirror_num, 0);
  	if (ret) {
  		bio->bi_error = ret;
  		bio_endio(comp_bio);

^ permalink raw reply	[flat|nested] 18+ messages in thread

* linux-next: manual merge of the block tree with the btrfs-kdave tree
@ 2016-06-24  2:34 Stephen Rothwell
  0 siblings, 0 replies; 18+ messages in thread
From: Stephen Rothwell @ 2016-06-24  2:34 UTC (permalink / raw)
  To: Jens Axboe, David Sterba; +Cc: linux-next, linux-kernel, Liu Bo, Mike Christie

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/compression.c

between commit:

  edf0e062aa6f ("Btrfs: fix BUG_ON in btrfs_submit_compressed_write")

from the btrfs-kdave tree and commit:

  81a75f6781de ("btrfs: use bio fields for op and flags")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/compression.c
index 7a4d9c81aa2a,cefedabf0a92..000000000000
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@@ -401,11 -402,8 +402,11 @@@ int btrfs_submit_compressed_write(struc
  				BUG_ON(ret); /* -ENOMEM */
  			}
  
- 			ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
+ 			ret = btrfs_map_bio(root, bio, 0, 1);
 -			BUG_ON(ret); /* -ENOMEM */
 +			if (ret) {
 +				bio->bi_error = ret;
 +				bio_endio(bio);
 +			}
  
  			bio_put(bio);
  
@@@ -434,11 -433,8 +436,11 @@@
  		BUG_ON(ret); /* -ENOMEM */
  	}
  
- 	ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
+ 	ret = btrfs_map_bio(root, bio, 0, 1);
 -	BUG_ON(ret); /* -ENOMEM */
 +	if (ret) {
 +		bio->bi_error = ret;
 +		bio_endio(bio);
 +	}
  
  	bio_put(bio);
  	return 0;

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-02-18  1:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-13  3:15 linux-next: manual merge of the block tree with the btrfs-kdave tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2019-02-18  1:07 Stephen Rothwell
2017-06-21  3:13 Stephen Rothwell
2017-06-20  1:37 Stephen Rothwell
2017-06-13  3:50 Stephen Rothwell
2017-06-13  3:34 Stephen Rothwell
2017-06-13  3:27 Stephen Rothwell
2016-11-17  2:01 Stephen Rothwell
2016-11-17  2:49 ` Jens Axboe
2016-11-17 13:23   ` Christoph Hellwig
2016-11-18 17:47     ` David Sterba
2016-07-08  4:03 Stephen Rothwell
2016-07-08  4:00 Stephen Rothwell
2016-07-08  3:49 Stephen Rothwell
2016-07-08  3:31 Stephen Rothwell
2016-07-08  3:27 Stephen Rothwell
2016-07-08  3:26 Stephen Rothwell
2016-06-24  2:34 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).