linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the block tree with the btrfs tree
@ 2021-02-02  2:45 Stephen Rothwell
  2021-02-14 22:17 ` Stephen Rothwell
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Rothwell @ 2021-02-02  2:45 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: David Sterba, Linux Kernel Mailing List, Linux Next Mailing List,
	Naohiro Aota, Pavel Begunkov

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

Hi all,

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

  fs/iomap/direct-io.c

between commit:

  dffd1df2d29a ("iomap: support REQ_OP_ZONE_APPEND")

from the btrfs tree and commit:

  3e1a88ec9625 ("bio: add a helper calculating nr segments to alloc")

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/iomap/direct-io.c
index e4c258a2cefc,ea1e8f696076..000000000000
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@@ -292,13 -260,7 +289,14 @@@ iomap_dio_bio_actor(struct inode *inode
  			iomap_dio_zero(dio, iomap, pos - pad, pad);
  	}
  
 +	/*
 +	 * Set the operation flags early so that bio_iov_iter_get_pages
 +	 * can set up the page vector appropriately for a ZONE_APPEND
 +	 * operation.
 +	 */
 +	bio_opf = iomap_dio_bio_opflags(dio, iomap, use_fua);
 +
+ 	nr_pages = bio_iov_vecs_to_alloc(dio->submit.iter, BIO_MAX_PAGES);
  	do {
  		size_t n;
  		if (dio->error) {

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

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

* Re: linux-next: manual merge of the block tree with the btrfs tree
  2021-02-02  2:45 linux-next: manual merge of the block tree with the btrfs tree Stephen Rothwell
@ 2021-02-14 22:17 ` Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2021-02-14 22:17 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: David Sterba, Linux Kernel Mailing List, Linux Next Mailing List,
	Naohiro Aota, Pavel Begunkov

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

Hi all,

On Tue, 2 Feb 2021 13:45:59 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the block tree got a conflict in:
> 
>   fs/iomap/direct-io.c
> 
> between commit:
> 
>   dffd1df2d29a ("iomap: support REQ_OP_ZONE_APPEND")
> 
> from the btrfs tree and commit:
> 
>   3e1a88ec9625 ("bio: add a helper calculating nr segments to alloc")
> 
> 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.
> 
> diff --cc fs/iomap/direct-io.c
> index e4c258a2cefc,ea1e8f696076..000000000000
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@@ -292,13 -260,7 +289,14 @@@ iomap_dio_bio_actor(struct inode *inode
>   			iomap_dio_zero(dio, iomap, pos - pad, pad);
>   	}
>   
>  +	/*
>  +	 * Set the operation flags early so that bio_iov_iter_get_pages
>  +	 * can set up the page vector appropriately for a ZONE_APPEND
>  +	 * operation.
>  +	 */
>  +	bio_opf = iomap_dio_bio_opflags(dio, iomap, use_fua);
>  +
> + 	nr_pages = bio_iov_vecs_to_alloc(dio->submit.iter, BIO_MAX_PAGES);
>   	do {
>   		size_t n;
>   		if (dio->error) {

With the merge window about to open, this is a reminder that this
conflict still exists.

The btrfs tree commit is now

  c3b0e880bbfa ("iomap: support REQ_OP_ZONE_APPEND")

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the block tree with the btrfs tree
  2023-12-21  2:45 Stephen Rothwell
@ 2023-12-21  5:23 ` Christoph Hellwig
  0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2023-12-21  5:23 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, David Sterba, Christoph Hellwig, David Sterba,
	Linux Kernel Mailing List, Linux Next Mailing List

Hi Stephen,

the merge looks good, thanks.  Although the comment is somewhat redundant
now and could actually be removed.


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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2023-12-21  2:45 Stephen Rothwell
  2023-12-21  5:23 ` Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Rothwell @ 2023-12-21  2:45 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Christoph Hellwig, David Sterba, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

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

  fs/btrfs/zoned.h

between commit:

  eefaf0a1a6f1 ("btrfs: fix typos found by codespell")

from the btrfs tree and commit:

  7437bb73f087 ("block: remove support for the host aware zone model")

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/zoned.h
index f24a5ffb7807,bc1b540c1597..000000000000
--- a/fs/btrfs/zoned.h
+++ b/fs/btrfs/zoned.h
@@@ -319,8 -323,8 +319,8 @@@ static inline bool btrfs_check_device_z
  			(bdev_zone_sectors(bdev) << SECTOR_SHIFT);
  	}
  
 -	/* Do not allow Host Manged zoned device */
 +	/* Do not allow Host Managed zoned device. */
- 	return bdev_zoned_model(bdev) != BLK_ZONED_HM;
+ 	return !bdev_is_zoned(bdev);
  }
  
  static inline bool btrfs_check_super_location(struct btrfs_device *device, u64 pos)

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

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2022-07-15  3:25 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2022-07-15  3:25 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Bart Van Assche, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

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

  fs/btrfs/compression.c
  fs/btrfs/extent_io.c
  fs/btrfs/raid56.c

between commits:

  7c16aa15d58b ("btrfs: simplify the pending I/O counting in struct compressed_bio")
  50d003d4254c ("btrfs: centralize setting REQ_META")
  9fab7af28df7 ("btrfs: raid56: use fixed stripe length everywhere")

from the btrfs tree and commit:

  bf9486d6dd23 ("fs/btrfs: Use the enum req_op and blk_opf_t types")

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 b6fb8b0682ba,a82b9f17f476..000000000000
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@@ -394,10 -514,10 +394,10 @@@ blk_status_t btrfs_submit_compressed_wr
  	struct compressed_bio *cb;
  	u64 cur_disk_bytenr = disk_start;
  	u64 next_stripe_start;
 -	blk_status_t ret;
  	int skip_sum = inode->flags & BTRFS_INODE_NODATASUM;
  	const bool use_append = btrfs_use_zone_append(inode, disk_start);
- 	const unsigned int bio_op = use_append ? REQ_OP_ZONE_APPEND : REQ_OP_WRITE;
+ 	const enum req_op bio_op = use_append ? REQ_OP_ZONE_APPEND : REQ_OP_WRITE;
 +	blk_status_t ret = BLK_STS_OK;
  
  	ASSERT(IS_ALIGNED(start, fs_info->sectorsize) &&
  	       IS_ALIGNED(len, fs_info->sectorsize));
diff --cc fs/btrfs/extent_io.c
index db95de608ce3,60a20df353e7..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -4531,7 -4575,7 +4531,7 @@@ static int write_one_subpage_eb(struct 
  {
  	struct btrfs_fs_info *fs_info = eb->fs_info;
  	struct page *page = eb->pages[0];
- 	unsigned int write_flags = wbc_to_write_flags(wbc);
 -	blk_opf_t write_flags = wbc_to_write_flags(wbc) | REQ_META;
++	blk_opf_t write_flags = wbc_to_write_flags(wbc);
  	bool no_dirty_ebs = false;
  	int ret;
  
@@@ -4576,7 -4620,7 +4576,7 @@@ static noinline_for_stack int write_one
  {
  	u64 disk_bytenr = eb->start;
  	int i, num_pages;
- 	unsigned int write_flags = wbc_to_write_flags(wbc);
 -	blk_opf_t write_flags = wbc_to_write_flags(wbc) | REQ_META;
++	blk_opf_t write_flags = wbc_to_write_flags(wbc);
  	int ret = 0;
  
  	prepare_eb_write(eb);
diff --cc fs/btrfs/raid56.c
index 1afe32d5ab01,c520412d1f86..000000000000
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@@ -1018,7 -1135,8 +1018,7 @@@ static int rbio_add_io_sector(struct bt
  			      struct sector_ptr *sector,
  			      unsigned int stripe_nr,
  			      unsigned int sector_nr,
- 			      unsigned int opf)
 -			      unsigned long bio_max_len,
+ 			      enum req_op op)
  {
  	const u32 sectorsize = rbio->bioc->fs_info->sectorsize;
  	struct bio *last = bio_list->tail;
@@@ -1062,9 -1180,8 +1062,9 @@@
  	}
  
  	/* put a new bio on the list */
 -	bio = bio_alloc(stripe->dev->bdev, max(bio_max_len >> PAGE_SHIFT, 1UL),
 +	bio = bio_alloc(stripe->dev->bdev,
 +			max(BTRFS_STRIPE_LEN >> PAGE_SHIFT, 1),
- 			opf, GFP_NOFS);
+ 			op, GFP_NOFS);
  	bio->bi_iter.bi_sector = disk_start >> 9;
  	bio->bi_private = rbio;
  

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

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

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

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

Hi all,

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

  fs/btrfs/check-integrity.c

between commit:

  068afafa2589 ("btrfs: drop casts of bio bi_sector")

from the btrfs tree and commit:

  051707baf43b ("block: store a block_device pointer in struct bio")

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/check-integrity.c
index 6ff44e53814c,8791ad9b3ca5..000000000000
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@@ -2690,9 -2693,10 +2690,9 @@@ static void __btrfsic_submit_bio(struc
  		bio_is_patched = 0;
  		if (dev_state->state->print_mask &
  		    BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH)
- 			pr_info("submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_disk=%p)\n",
+ 			pr_info("submit_bio(rw=%d,0x%x, bi_vcnt=%u, bi_sector=%llu (bytenr %llu), bi_bdev=%p)\n",
  			       bio_op(bio), bio->bi_opf, segs,
- 			       bio->bi_iter.bi_sector, dev_bytenr, bio->bi_disk);
 -			       (unsigned long long)bio->bi_iter.bi_sector,
 -			       dev_bytenr, bio->bi_bdev);
++			       bio->bi_iter.bi_sector, dev_bytenr, bio->bi_bdev);
  
  		mapped_datav = kmalloc_array(segs,
  					     sizeof(*mapped_datav), GFP_NOFS);

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

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2020-07-09  2:58 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2020-07-09  2:58 UTC (permalink / raw)
  To: Jens Axboe, David Sterba
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Qu Wenruo

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

Hi all,

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

  fs/btrfs/disk-io.c

between commit:

  16e1dd6a777e ("btrfs: preallocate anon block device at first phase of snapshot creation")

from the btrfs tree and commit:

  21cf86614504 ("writeback: remove bdi->congested_fn")

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 08140caceb33,eb5f2506cede..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -1649,54 -1616,6 +1649,33 @@@ fail
  	return ERR_PTR(ret);
  }
  
 +/*
 + * Get in-memory reference of a root structure
 + *
 + * @objectid:	tree objectid
 + * @check_ref:	if set, verify that the tree exists and the item has at least
 + *		one reference
 + */
 +struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
 +				     u64 objectid, bool check_ref)
 +{
 +	return btrfs_get_root_ref(fs_info, objectid, 0, check_ref);
 +}
 +
 +/*
 + * Get in-memory reference of a root structure, created as new, optionally pass
 + * the anonymous block device id
 + *
 + * @objectid:	tree objectid
 + * @anon_dev:	if zero, allocate a new anonymous block device or use the
 + *		parameter value
 + */
 +struct btrfs_root *btrfs_get_new_fs_root(struct btrfs_fs_info *fs_info,
 +					 u64 objectid, dev_t anon_dev)
 +{
 +	return btrfs_get_root_ref(fs_info, objectid, anon_dev, true);
 +}
 +
- static int btrfs_congested_fn(void *congested_data, int bdi_bits)
- {
- 	struct btrfs_fs_info *info = (struct btrfs_fs_info *)congested_data;
- 	int ret = 0;
- 	struct btrfs_device *device;
- 	struct backing_dev_info *bdi;
- 
- 	rcu_read_lock();
- 	list_for_each_entry_rcu(device, &info->fs_devices->devices, dev_list) {
- 		if (!device->bdev)
- 			continue;
- 		bdi = device->bdev->bd_bdi;
- 		if (bdi_congested(bdi, bdi_bits)) {
- 			ret = 1;
- 			break;
- 		}
- 	}
- 	rcu_read_unlock();
- 	return ret;
- }
- 
  /*
   * called by the kthread helper functions to finally call the bio end_io
   * functions.  This is where read checksum verification actually happens

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

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

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

Hi Jens,

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

  fs/btrfs/extent_io.c

between commit:

  f338d193e1c5 ("Btrfs: fix eb memory leak due to readpage failure")

from the btrfs tree and commit:

  1f7ad75b13b5 ("btrfs: have submit_one_bio users use bio op accessors")

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 b8ecc6af4531,4f8bace0fd1b..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -5253,18 -5225,9 +5251,18 @@@ int read_extent_buffer_pages(struct ext
  			err = __extent_read_full_page(tree, page,
  						      get_extent, &bio,
  						      mirror_num, &bio_flags,
- 						      READ | REQ_META);
+ 						      REQ_META);
 -			if (err)
 +			if (err) {
  				ret = err;
 +				/*
 +				 * We use &bio in above __extent_read_full_page,
 +				 * so we ensure that if it returns error, the
 +				 * current page fails to add itself to bio.
 +				 *
 +				 * We must dec io_pages by ourselves.
 +				 */
 +				atomic_dec(&eb->io_pages);
 +			}
  		} else {
  			unlock_page(page);
  		}

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2015-08-24  4:16 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2015-08-24  4:16 UTC (permalink / raw)
  To: Jens Axboe, Chris Mason; +Cc: linux-next, linux-kernel, Kent Overstreet

Hi Jens,

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

  fs/btrfs/inode.c

between commit:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")

from the btrfs tree and commit:

  b54ffb73cadc ("block: remove bio_get_nr_vecs()")

from the block tree.

I fixed it up (following Chris's example merge - see below) and can
carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/btrfs/inode.c
index bda3c41dc9d5,f924d9a62700..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7986,12 -7958,7 +7987,11 @@@ out
  static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
  				       u64 first_sector, gfp_t gfp_flags)
  {
- 	int nr_vecs = bio_get_nr_vecs(bdev);
 -	return btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +	struct bio *bio;
- 	bio = btrfs_bio_alloc(bdev, first_sector, nr_vecs, gfp_flags);
++	bio = btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +	if (bio)
 +		bio_associate_current(bio);
 +	return bio;
  }
  
  static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root,

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2015-08-24  4:16 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2015-08-24  4:16 UTC (permalink / raw)
  To: Jens Axboe, Chris Mason, Josef Bacik
  Cc: linux-next, linux-kernel, Omar Sandoval, Christoph Hellwig

Hi Jens,

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

  fs/btrfs/raid56.c

between commit:

  b4ee1782686d ("Btrfs: add RAID 5/6 BTRFS_RBIO_REBUILD_MISSING operation")

from the btrfs tree and commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the block tree.

I fixed it up (using Chris's example merge - see below) and can carry
the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/btrfs/raid56.c
index 6fe2613ef288,0a02e24900aa..000000000000
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@@ -1975,9 -1960,7 +1971,9 @@@ cleanup_io
  		else
  			clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags);
  
- 		rbio_orig_end_io(rbio, err, err == 0);
+ 		rbio_orig_end_io(rbio, err);
 +	} else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
- 		rbio_orig_end_io(rbio, err, err == 0);
++		rbio_orig_end_io(rbio, err);
  	} else if (err == 0) {
  		rbio->faila = -1;
  		rbio->failb = -1;
@@@ -2114,9 -2096,8 +2109,9 @@@ out
  	return 0;
  
  cleanup:
 -	if (rbio->operation == BTRFS_RBIO_READ_REBUILD)
 +	if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
 +	    rbio->operation == BTRFS_RBIO_REBUILD_MISSING)
- 		rbio_orig_end_io(rbio, -EIO, 0);
+ 		rbio_orig_end_io(rbio, -EIO);
  	return -EIO;
  }
  

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2015-08-24  4:15 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2015-08-24  4:15 UTC (permalink / raw)
  To: Jens Axboe, Chris Mason, Josef Bacik
  Cc: linux-next, linux-kernel, Christoph Hellwig, Omar Sandoval

Hi Jens,

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

  fs/btrfs/scrub.c

between commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the btrfs tree and commit:

  03679ade86b2 ("Btrfs: remove misleading handling of missing device scrub")

from the block tree.

I fixed it up (using Chris' example merge - see below) and can carry
the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/btrfs/scrub.c
index c69c75e7b841,9c146d8307b5..000000000000
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@@ -2174,134 -2165,6 +2161,134 @@@ again
  	return 0;
  }
  
- static void scrub_missing_raid56_end_io(struct bio *bio, int error)
++static void scrub_missing_raid56_end_io(struct bio *bio)
 +{
 +	struct scrub_block *sblock = bio->bi_private;
 +	struct btrfs_fs_info *fs_info = sblock->sctx->dev_root->fs_info;
 +
- 	if (error)
++	if (bio->bi_error)
 +		sblock->no_io_error_seen = 0;
 +
 +	btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
 +}
 +
 +static void scrub_missing_raid56_worker(struct btrfs_work *work)
 +{
 +	struct scrub_block *sblock = container_of(work, struct scrub_block, work);
 +	struct scrub_ctx *sctx = sblock->sctx;
 +	struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +	unsigned int is_metadata;
 +	unsigned int have_csum;
 +	u8 *csum;
 +	u64 generation;
 +	u64 logical;
 +	struct btrfs_device *dev;
 +
 +	is_metadata = !(sblock->pagev[0]->flags & BTRFS_EXTENT_FLAG_DATA);
 +	have_csum = sblock->pagev[0]->have_csum;
 +	csum = sblock->pagev[0]->csum;
 +	generation = sblock->pagev[0]->generation;
 +	logical = sblock->pagev[0]->logical;
 +	dev = sblock->pagev[0]->dev;
 +
 +	if (sblock->no_io_error_seen) {
 +		scrub_recheck_block_checksum(fs_info, sblock, is_metadata,
 +					     have_csum, csum, generation,
 +					     sctx->csum_size);
 +	}
 +
 +	if (!sblock->no_io_error_seen) {
 +		spin_lock(&sctx->stat_lock);
 +		sctx->stat.read_errors++;
 +		spin_unlock(&sctx->stat_lock);
 +		printk_ratelimited_in_rcu(KERN_ERR
 +			"BTRFS: I/O error rebulding logical %llu for dev %s\n",
 +			logical, rcu_str_deref(dev->name));
 +	} else if (sblock->header_error || sblock->checksum_error) {
 +		spin_lock(&sctx->stat_lock);
 +		sctx->stat.uncorrectable_errors++;
 +		spin_unlock(&sctx->stat_lock);
 +		printk_ratelimited_in_rcu(KERN_ERR
 +			"BTRFS: failed to rebuild valid logical %llu for dev %s\n",
 +			logical, rcu_str_deref(dev->name));
 +	} else {
 +		scrub_write_block_to_dev_replace(sblock);
 +	}
 +
 +	scrub_block_put(sblock);
 +
 +	if (sctx->is_dev_replace &&
 +	    atomic_read(&sctx->wr_ctx.flush_all_writes)) {
 +		mutex_lock(&sctx->wr_ctx.wr_lock);
 +		scrub_wr_submit(sctx);
 +		mutex_unlock(&sctx->wr_ctx.wr_lock);
 +	}
 +
 +	scrub_pending_bio_dec(sctx);
 +}
 +
 +static void scrub_missing_raid56_pages(struct scrub_block *sblock)
 +{
 +	struct scrub_ctx *sctx = sblock->sctx;
 +	struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +	u64 length = sblock->page_count * PAGE_SIZE;
 +	u64 logical = sblock->pagev[0]->logical;
 +	struct btrfs_bio *bbio;
 +	struct bio *bio;
 +	struct btrfs_raid_bio *rbio;
 +	int ret;
 +	int i;
 +
 +	ret = btrfs_map_sblock(fs_info, REQ_GET_READ_MIRRORS, logical, &length,
 +			       &bbio, 0, 1);
 +	if (ret || !bbio || !bbio->raid_map)
 +		goto bbio_out;
 +
 +	if (WARN_ON(!sctx->is_dev_replace ||
 +		    !(bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK))) {
 +		/*
 +		 * We shouldn't be scrubbing a missing device. Even for dev
 +		 * replace, we should only get here for RAID 5/6. We either
 +		 * managed to mount something with no mirrors remaining or
 +		 * there's a bug in scrub_remap_extent()/btrfs_map_block().
 +		 */
 +		goto bbio_out;
 +	}
 +
 +	bio = btrfs_io_bio_alloc(GFP_NOFS, 0);
 +	if (!bio)
 +		goto bbio_out;
 +
 +	bio->bi_iter.bi_sector = logical >> 9;
 +	bio->bi_private = sblock;
 +	bio->bi_end_io = scrub_missing_raid56_end_io;
 +
 +	rbio = raid56_alloc_missing_rbio(sctx->dev_root, bio, bbio, length);
 +	if (!rbio)
 +		goto rbio_out;
 +
 +	for (i = 0; i < sblock->page_count; i++) {
 +		struct scrub_page *spage = sblock->pagev[i];
 +
 +		raid56_add_scrub_pages(rbio, spage->page, spage->logical);
 +	}
 +
 +	btrfs_init_work(&sblock->work, btrfs_scrub_helper,
 +			scrub_missing_raid56_worker, NULL, NULL);
 +	scrub_block_get(sblock);
 +	scrub_pending_bio_inc(sctx);
 +	raid56_submit_missing_rbio(rbio);
 +	return;
 +
 +rbio_out:
 +	bio_put(bio);
 +bbio_out:
 +	btrfs_put_bbio(bbio);
 +	spin_lock(&sctx->stat_lock);
 +	sctx->stat.malloc_errors++;
 +	spin_unlock(&sctx->stat_lock);
 +}
 +
  static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u64 len,
  		       u64 physical, struct btrfs_device *dev, u64 flags,
  		       u64 gen, int mirror_num, u8 *csum, int force,

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2015-08-24  4:15 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2015-08-24  4:15 UTC (permalink / raw)
  To: Jens Axboe, Chris Mason, Josef Bacik
  Cc: linux-next, linux-kernel, Kent Overstreet

Hi Jens,

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

  fs/btrfs/volumes.c

between commits:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")
  3a9508b0221d ("btrfs: fix compile when block cgroups are not enabled")

from the btrfs tree and commit:

  0e28997ec476 ("btrfs: remove bio splitting and merge_bvec_fn() calls")

from the block tree.

I fixed it up (I removed breakup_stripe_bio) and can carry the fix as
necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

* linux-next: manual merge of the block tree with the btrfs tree
@ 2014-01-09  4:01 Stephen Rothwell
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Rothwell @ 2014-01-09  4:01 UTC (permalink / raw)
  To: Jens Axboe, Chris Mason, Josef Bacik
  Cc: linux-next, linux-kernel, Kent Overstreet, Valentina Giusti

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

Hi Jens,

Today's linux-next merge of the block tree got a conflict in
fs/btrfs/extent_io.c between commit 1c94f854cbb6 ("btrfs: remove unused
variables from extent_io.c") from the btrfs tree and commit 2c30c71bd653
("block: Convert various code to bio_for_each_segment()") from the block
tree.

I fixed it up (thanks Chris for the heads up and resolution - see below)
and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/btrfs/extent_io.c
index fbe501d3bd01,bcb6f1b780d6..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -2375,12 -2332,15 +2375,13 @@@ int end_extent_writepage(struct page *p
   */
  static void end_bio_extent_writepage(struct bio *bio, int err)
  {
- 	struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
+ 	struct bio_vec *bvec;
 -	struct extent_io_tree *tree;
  	u64 start;
  	u64 end;
+ 	int i;
  
- 	do {
+ 	bio_for_each_segment_all(bvec, bio, i) {
  		struct page *page = bvec->bv_page;
 -		tree = &BTRFS_I(page->mapping->host)->io_tree;
  
  		/* We always issue full-page reads, but if some block
  		 * in a page fails to read, blk_update_request() will

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2023-12-21  5:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02  2:45 linux-next: manual merge of the block tree with the btrfs tree Stephen Rothwell
2021-02-14 22:17 ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-12-21  2:45 Stephen Rothwell
2023-12-21  5:23 ` Christoph Hellwig
2022-07-15  3:25 Stephen Rothwell
2020-12-07  2:44 Stephen Rothwell
2020-07-09  2:58 Stephen Rothwell
2016-06-14  2:44 Stephen Rothwell
2015-08-24  4:16 Stephen Rothwell
2015-08-24  4:16 Stephen Rothwell
2015-08-24  4:15 Stephen Rothwell
2015-08-24  4:15 Stephen Rothwell
2014-01-09  4:01 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).