linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the md tree with the block tree
@ 2014-01-15  4:07 Stephen Rothwell
  2014-01-15  5:30 ` NeilBrown
  0 siblings, 1 reply; 17+ messages in thread
From: Stephen Rothwell @ 2014-01-15  4:07 UTC (permalink / raw)
  To: Neil Brown, Jens Axboe; +Cc: linux-next, linux-kernel, Kent Overstreet

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

Hi Neil,

Today's linux-next merge of the md tree got a conflict in
drivers/md/raid10.c between commit 4f024f3797c4 ("block: Abstract out
bvec iterator") from the block tree and commit b50c259e25d9 ("md/raid10:
fix two bugs in handling of known-bad-blocks") from the md tree.

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

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

diff --cc drivers/md/raid10.c
index 6d43d88657aa,8d39d63281b9..000000000000
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@@ -1256,8 -1319,8 +1256,8 @@@ read_again
  			/* Could not read all from this device, so we will
  			 * need another r10_bio.
  			 */
- 			sectors_handled = (r10_bio->sectors + max_sectors
+ 			sectors_handled = (r10_bio->sector + max_sectors
 -					   - bio->bi_sector);
 +					   - bio->bi_iter.bi_sector);
  			r10_bio->sectors = max_sectors;
  			spin_lock_irq(&conf->device_lock);
  			if (bio->bi_phys_segments == 0)

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

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

* Re: linux-next: manual merge of the md tree with the block tree
  2014-01-15  4:07 linux-next: manual merge of the md tree with the block tree Stephen Rothwell
@ 2014-01-15  5:30 ` NeilBrown
  0 siblings, 0 replies; 17+ messages in thread
From: NeilBrown @ 2014-01-15  5:30 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Jens Axboe, linux-next, linux-kernel, Kent Overstreet

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

On Wed, 15 Jan 2014 15:07:43 +1100 Stephen Rothwell <sfr@canb.auug.org.au>
wrote:

> Hi Neil,
> 
> Today's linux-next merge of the md tree got a conflict in
> drivers/md/raid10.c between commit 4f024f3797c4 ("block: Abstract out
> bvec iterator") from the block tree and commit b50c259e25d9 ("md/raid10:
> fix two bugs in handling of known-bad-blocks") from the md tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).
> 

Thanks Stephen.
Those md fixes are now on their way to Linus (I'm hoping for 3.13 inclusion,
I might be lucky).  Good they they are easy to resolve!

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* linux-next: manual merge of the md tree with the block tree
@ 2018-05-31  4:34 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2018-05-31  4:34 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Kent Overstreet, Xiao Ni

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

Hi all,

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

  drivers/md/md.c

between commit:

  afeee514ce7f ("md: convert to bioset_init()/mempool_init()")

from the block tree and commit:

  5a409b4f56d5 ("MD: fix lock contention for flush bios")

from the md 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 drivers/md/md.c
index fc692b7128bb,6b4e2f29fe4e..000000000000
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@@ -5498,16 -5518,34 +5519,32 @@@ int md_run(struct mddev *mddev
  		sysfs_notify_dirent_safe(rdev->sysfs_state);
  	}
  
 -	if (mddev->bio_set == NULL) {
 -		mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
 -		if (!mddev->bio_set)
 -			return -ENOMEM;
 +	if (!bioset_initialized(&mddev->bio_set)) {
 +		err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
 +		if (err)
 +			return err;
  	}
 -	if (mddev->sync_set == NULL) {
 -		mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
 -		if (!mddev->sync_set) {
 -			err = -ENOMEM;
 +	if (!bioset_initialized(&mddev->sync_set)) {
 +		err = bioset_init(&mddev->sync_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
 +		if (err)
  			goto abort;
 -		}
  	}
+ 	if (mddev->flush_pool == NULL) {
+ 		mddev->flush_pool = mempool_create(NR_FLUSH_INFOS, flush_info_alloc,
+ 						flush_info_free, mddev);
+ 		if (!mddev->flush_pool) {
+ 			err = -ENOMEM;
+ 			goto abort;
+ 		}
+ 	}
+ 	if (mddev->flush_bio_pool == NULL) {
+ 		mddev->flush_bio_pool = mempool_create(NR_FLUSH_BIOS, flush_bio_alloc,
+ 						flush_bio_free, mddev);
+ 		if (!mddev->flush_bio_pool) {
+ 			err = -ENOMEM;
+ 			goto abort;
+ 		}
+ 	}
  
  	spin_lock(&pers_lock);
  	pers = find_pers(mddev->level, mddev->clevel);
@@@ -5667,8 -5705,22 +5704,16 @@@
  	return 0;
  
  abort:
+ 	if (mddev->flush_bio_pool) {
+ 		mempool_destroy(mddev->flush_bio_pool);
+ 		mddev->flush_bio_pool = NULL;
+ 	}
+ 	if (mddev->flush_pool){
+ 		mempool_destroy(mddev->flush_pool);
+ 		mddev->flush_pool = NULL;
+ 	}
 -	if (mddev->bio_set) {
 -		bioset_free(mddev->bio_set);
 -		mddev->bio_set = NULL;
 -	}
 -	if (mddev->sync_set) {
 -		bioset_free(mddev->sync_set);
 -		mddev->sync_set = NULL;
 -	}
 +	bioset_exit(&mddev->bio_set);
 +	bioset_exit(&mddev->sync_set);
  
  	return err;
  }
@@@ -5881,8 -5933,22 +5926,16 @@@ void md_stop(struct mddev *mddev
  	 * This is called from dm-raid
  	 */
  	__md_stop(mddev);
+ 	if (mddev->flush_bio_pool) {
+ 		mempool_destroy(mddev->flush_bio_pool);
+ 		mddev->flush_bio_pool = NULL;
+ 	}
+ 	if (mddev->flush_pool) {
+ 		mempool_destroy(mddev->flush_pool);
+ 		mddev->flush_pool = NULL;
+ 	}
 -	if (mddev->bio_set) {
 -		bioset_free(mddev->bio_set);
 -		mddev->bio_set = NULL;
 -	}
 -	if (mddev->sync_set) {
 -		bioset_free(mddev->sync_set);
 -		mddev->sync_set = NULL;
 -	}
 +	bioset_exit(&mddev->bio_set);
 +	bioset_exit(&mddev->sync_set);
  }
  
  EXPORT_SYMBOL_GPL(md_stop);

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

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

* linux-next: manual merge of the md tree with the block tree
@ 2017-08-29  4:13 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2017-08-29  4:13 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Pawel Baldysiak, Artur Paszkiewicz

Hi Shaohua,

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

  drivers/md/raid5-ppl.c

between commit:

  74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index")

from the block tree and commit:

  ddc088238cd6 ("md: Runtime support for multiple ppls")

from the md 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 drivers/md/raid5-ppl.c
index 1e237c40d6fa,a98ef172f8e8..000000000000
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@@ -451,12 -456,25 +456,25 @@@ static void ppl_submit_iounit(struct pp
  	pplhdr->entries_count = cpu_to_le32(io->entries_count);
  	pplhdr->checksum = cpu_to_le32(~crc32c_le(~0, pplhdr, PPL_HEADER_SIZE));
  
+ 	/* Rewind the buffer if current PPL is larger then remaining space */
+ 	if (log->use_multippl &&
+ 	    log->rdev->ppl.sector + log->rdev->ppl.size - log->next_io_sector <
+ 	    (PPL_HEADER_SIZE + io->pp_size) >> 9)
+ 		log->next_io_sector = log->rdev->ppl.sector;
+ 
+ 
  	bio->bi_end_io = ppl_log_endio;
  	bio->bi_opf = REQ_OP_WRITE | REQ_FUA;
 -	bio->bi_bdev = log->rdev->bdev;
 +	bio_set_dev(bio, log->rdev->bdev);
- 	bio->bi_iter.bi_sector = log->rdev->ppl.sector;
+ 	bio->bi_iter.bi_sector = log->next_io_sector;
  	bio_add_page(bio, io->header_page, PAGE_SIZE, 0);
  
+ 	pr_debug("%s: log->current_io_sector: %llu\n", __func__,
+ 	    (unsigned long long)log->next_io_sector);
+ 
+ 	if (log->use_multippl)
+ 		log->next_io_sector += (PPL_HEADER_SIZE + io->pp_size) >> 9;
+ 
  	list_for_each_entry(sh, &io->stripe_list, log_list) {
  		/* entries for full stripe writes have no partial parity */
  		if (test_bit(STRIPE_FULL_WRITE, &sh->state))

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

* linux-next: manual merge of the md tree with the block tree
@ 2017-06-13  4:33 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2017-06-13  4:33 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Guoqing Jiang

Hi Shaohua,

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

  drivers/md/raid5.c

between commit:

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

from the block tree and commit:

  66a8066d55fd ("md: simplify code with bio_io_error")

from the md tree.

I fixed it up (the latter removed code updated by the former) 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] 17+ messages in thread

* linux-next: manual merge of the md tree with the block tree
@ 2017-04-12  2:31 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2017-04-12  2:31 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, NeilBrown

Hi all,

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

  drivers/md/linear.c
  drivers/md/raid0.c

between commit:

  3deff1a70d59 ("md: support REQ_OP_WRITE_ZEROES")

from the block tree and commits:

  868f604b1de2 ("md/linear: improve bio splitting.")
  f00d7c85be9e ("md/raid0: fix up bio splitting.")

from the md 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 drivers/md/linear.c
index 377a8a3672e3,f16316fbf658..000000000000
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@@ -257,46 -257,40 +257,41 @@@ static void linear_make_request(struct 
  		return;
  	}
  
- 	do {
- 		sector_t bio_sector = bio->bi_iter.bi_sector;
- 		tmp_dev = which_dev(mddev, bio_sector);
- 		start_sector = tmp_dev->end_sector - tmp_dev->rdev->sectors;
- 		end_sector = tmp_dev->end_sector;
- 		data_offset = tmp_dev->rdev->data_offset;
- 		bio->bi_bdev = tmp_dev->rdev->bdev;
- 
- 		if (unlikely(bio_sector >= end_sector ||
- 			     bio_sector < start_sector))
- 			goto out_of_bounds;
- 
- 		if (unlikely(bio_end_sector(bio) > end_sector)) {
- 			/* This bio crosses a device boundary, so we have to
- 			 * split it.
- 			 */
- 			split = bio_split(bio, end_sector - bio_sector,
- 					  GFP_NOIO, fs_bio_set);
- 			bio_chain(split, bio);
- 		} else {
- 			split = bio;
- 		}
+ 	tmp_dev = which_dev(mddev, bio_sector);
+ 	start_sector = tmp_dev->end_sector - tmp_dev->rdev->sectors;
+ 	end_sector = tmp_dev->end_sector;
+ 	data_offset = tmp_dev->rdev->data_offset;
+ 
+ 	if (unlikely(bio_sector >= end_sector ||
+ 		     bio_sector < start_sector))
+ 		goto out_of_bounds;
+ 
+ 	if (unlikely(bio_end_sector(bio) > end_sector)) {
+ 		/* This bio crosses a device boundary, so we have to split it */
+ 		struct bio *split = bio_split(bio, end_sector - bio_sector,
+ 					      GFP_NOIO, mddev->bio_set);
+ 		bio_chain(split, bio);
+ 		generic_make_request(bio);
+ 		bio = split;
+ 	}
  
- 		split->bi_iter.bi_sector = split->bi_iter.bi_sector -
- 			start_sector + data_offset;
- 
- 		if (unlikely((bio_op(split) == REQ_OP_DISCARD) &&
- 			 !blk_queue_discard(bdev_get_queue(split->bi_bdev)))) {
- 			/* Just ignore it */
- 			bio_endio(split);
- 		} else {
- 			if (mddev->gendisk)
- 				trace_block_bio_remap(bdev_get_queue(split->bi_bdev),
- 						      split, disk_devt(mddev->gendisk),
- 						      bio_sector);
- 			mddev_check_writesame(mddev, split);
- 			mddev_check_write_zeroes(mddev, split);
- 			generic_make_request(split);
- 		}
- 	} while (split != bio);
+ 	bio->bi_bdev = tmp_dev->rdev->bdev;
+ 	bio->bi_iter.bi_sector = bio->bi_iter.bi_sector -
+ 		start_sector + data_offset;
+ 
+ 	if (unlikely((bio_op(bio) == REQ_OP_DISCARD) &&
+ 		     !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) {
+ 		/* Just ignore it */
+ 		bio_endio(bio);
+ 	} else {
+ 		if (mddev->gendisk)
+ 			trace_block_bio_remap(bdev_get_queue(bio->bi_bdev),
+ 					      bio, disk_devt(mddev->gendisk),
+ 					      bio_sector);
+ 		mddev_check_writesame(mddev, bio);
++		mddev_check_write_zeroes(mddev, bio);
+ 		generic_make_request(bio);
+ 	}
  	return;
  
  out_of_bounds:
diff --cc drivers/md/raid0.c
index ce7a6a56cf73,e777e48f55f6..000000000000
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@@ -469,46 -472,43 +473,44 @@@ static void raid0_make_request(struct m
  		return;
  	}
  
- 	do {
- 		sector_t bio_sector = bio->bi_iter.bi_sector;
- 		sector_t sector = bio_sector;
- 		unsigned chunk_sects = mddev->chunk_sectors;
+ 	bio_sector = bio->bi_iter.bi_sector;
+ 	sector = bio_sector;
+ 	chunk_sects = mddev->chunk_sectors;
  
- 		unsigned sectors = chunk_sects -
- 			(likely(is_power_of_2(chunk_sects))
- 			 ? (sector & (chunk_sects-1))
- 			 : sector_div(sector, chunk_sects));
+ 	sectors = chunk_sects -
+ 		(likely(is_power_of_2(chunk_sects))
+ 		 ? (sector & (chunk_sects-1))
+ 		 : sector_div(sector, chunk_sects));
  
- 		/* Restore due to sector_div */
- 		sector = bio_sector;
+ 	/* Restore due to sector_div */
+ 	sector = bio_sector;
  
- 		if (sectors < bio_sectors(bio)) {
- 			split = bio_split(bio, sectors, GFP_NOIO, fs_bio_set);
- 			bio_chain(split, bio);
- 		} else {
- 			split = bio;
- 		}
+ 	if (sectors < bio_sectors(bio)) {
+ 		struct bio *split = bio_split(bio, sectors, GFP_NOIO, mddev->bio_set);
+ 		bio_chain(split, bio);
+ 		generic_make_request(bio);
+ 		bio = split;
+ 	}
  
- 		zone = find_zone(mddev->private, &sector);
- 		tmp_dev = map_sector(mddev, zone, sector, &sector);
- 		split->bi_bdev = tmp_dev->bdev;
- 		split->bi_iter.bi_sector = sector + zone->dev_start +
- 			tmp_dev->data_offset;
- 
- 		if (unlikely((bio_op(split) == REQ_OP_DISCARD) &&
- 			 !blk_queue_discard(bdev_get_queue(split->bi_bdev)))) {
- 			/* Just ignore it */
- 			bio_endio(split);
- 		} else {
- 			if (mddev->gendisk)
- 				trace_block_bio_remap(bdev_get_queue(split->bi_bdev),
- 						      split, disk_devt(mddev->gendisk),
- 						      bio_sector);
- 			mddev_check_writesame(mddev, split);
- 			mddev_check_write_zeroes(mddev, split);
- 			generic_make_request(split);
- 		}
- 	} while (split != bio);
+ 	zone = find_zone(mddev->private, &sector);
+ 	tmp_dev = map_sector(mddev, zone, sector, &sector);
+ 	bio->bi_bdev = tmp_dev->bdev;
+ 	bio->bi_iter.bi_sector = sector + zone->dev_start +
+ 		tmp_dev->data_offset;
+ 
+ 	if (unlikely((bio_op(bio) == REQ_OP_DISCARD) &&
+ 		     !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) {
+ 		/* Just ignore it */
+ 		bio_endio(bio);
+ 	} else {
+ 		if (mddev->gendisk)
+ 			trace_block_bio_remap(bdev_get_queue(bio->bi_bdev),
+ 					      bio, disk_devt(mddev->gendisk),
+ 					      bio_sector);
+ 		mddev_check_writesame(mddev, bio);
++		mddev_check_write_zeroes(mddev, bio);
+ 		generic_make_request(bio);
+ 	}
  }
  
  static void raid0_status(struct seq_file *seq, struct mddev *mddev)

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

* linux-next: manual merge of the md tree with the block tree
@ 2017-04-10  2:08 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2017-04-10  2:08 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, NeilBrown

Hi Shaohua,

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

  drivers/md/raid5.c

between commit:

  48920ff2a5a9 ("block: remove the discard_zeroes_data flag")

from the block tree and commit:

  97d53438081e ("Revert "md/raid5: limit request size according to implementation limits"")

from the md 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 drivers/md/raid5.c
index 2efdb0d67460,6036d5e41ddd..000000000000
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@@ -7253,17 -7361,13 +7358,9 @@@ static int raid5_run(struct mddev *mdde
  			stripe = (stripe | (stripe-1)) + 1;
  		mddev->queue->limits.discard_alignment = stripe;
  		mddev->queue->limits.discard_granularity = stripe;
 -		/*
 -		 * unaligned part of discard request will be ignored, so can't
 -		 * guarantee discard_zeroes_data
 -		 */
 -		mddev->queue->limits.discard_zeroes_data = 0;
  
- 		/*
- 		 * We use 16-bit counter of active stripes in bi_phys_segments
- 		 * (minus one for over-loaded initialization)
- 		 */
- 		blk_queue_max_hw_sectors(mddev->queue, 0xfffe * STRIPE_SECTORS);
- 		blk_queue_max_discard_sectors(mddev->queue,
- 					      0xfffe * STRIPE_SECTORS);
- 
  		blk_queue_max_write_same_sectors(mddev->queue, 0);
 +		blk_queue_max_write_zeroes_sectors(mddev->queue, 0);
  
  		rdev_for_each(rdev, mddev) {
  			disk_stack_limits(mddev->gendisk, rdev->bdev,

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

* linux-next: manual merge of the md tree with the block tree
@ 2017-04-10  2:03 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2017-04-10  2:03 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Christoph Hellwig, Ming Lei

Hi Shaohua,

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

  drivers/md/md.h

between commit:

  3deff1a70d59 ("md: support REQ_OP_WRITE_ZEROES")

from the block tree and commits:

  d8e29fbc3bed ("md: move two macros into md.h")
  513e2faa0138 ("md: prepare for managing resync I/O pages in clean way")

from the md 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 drivers/md/md.h
index 1e76d64ce180,0418b29945e7..000000000000
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@@ -710,10 -719,58 +719,65 @@@ static inline void mddev_check_writesam
  		mddev->queue->limits.max_write_same_sectors = 0;
  }
  
 +static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio)
 +{
 +	if (bio_op(bio) == REQ_OP_WRITE_ZEROES &&
 +	    !bdev_get_queue(bio->bi_bdev)->limits.max_write_zeroes_sectors)
 +		mddev->queue->limits.max_write_zeroes_sectors = 0;
 +}
++
+ /* Maximum size of each resync request */
+ #define RESYNC_BLOCK_SIZE (64*1024)
+ #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
+ 
+ /* for managing resync I/O pages */
+ struct resync_pages {
+ 	unsigned	idx;	/* for get/put page from the pool */
+ 	void		*raid_bio;
+ 	struct page	*pages[RESYNC_PAGES];
+ };
+ 
+ static inline int resync_alloc_pages(struct resync_pages *rp,
+ 				     gfp_t gfp_flags)
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < RESYNC_PAGES; i++) {
+ 		rp->pages[i] = alloc_page(gfp_flags);
+ 		if (!rp->pages[i])
+ 			goto out_free;
+ 	}
+ 
+ 	return 0;
+ 
+ out_free:
+ 	while (--i >= 0)
+ 		put_page(rp->pages[i]);
+ 	return -ENOMEM;
+ }
+ 
+ static inline void resync_free_pages(struct resync_pages *rp)
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < RESYNC_PAGES; i++)
+ 		put_page(rp->pages[i]);
+ }
+ 
+ static inline void resync_get_all_pages(struct resync_pages *rp)
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < RESYNC_PAGES; i++)
+ 		get_page(rp->pages[i]);
+ }
+ 
+ static inline struct page *resync_fetch_page(struct resync_pages *rp,
+ 					     unsigned idx)
+ {
+ 	if (WARN_ON_ONCE(idx >= RESYNC_PAGES))
+ 		return NULL;
+ 	return rp->pages[idx];
+ }
+ 
  #endif /* _MD_MD_H */

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

* linux-next: manual merge of the md tree with the block tree
@ 2016-11-23  2:17 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2016-11-23  2:17 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: linux-next, linux-kernel, Christoph Hellwig, NeilBrown

Hi Shaohua,

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

  drivers/md/md.c

between commit:

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

from the block tree and commit:

  46533ff7fefb ("md: Use REQ_FAILFAST_* on metadata writes where appropriate")

from the md tree.

I fixed it up (I think - 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 drivers/md/md.c
index f975cd08923d,c7894fbbd8e5..000000000000
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@@ -743,7 -765,12 +765,12 @@@ void md_super_write(struct mddev *mddev
  	bio_add_page(bio, page, size, 0);
  	bio->bi_private = rdev;
  	bio->bi_end_io = super_written;
- 	bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_FUA;
+ 
+ 	if (test_bit(MD_FAILFAST_SUPPORTED, &mddev->flags) &&
+ 	    test_bit(FailFast, &rdev->flags) &&
+ 	    !test_bit(LastDev, &rdev->flags))
+ 		ff = MD_FAILFAST;
 -	bio_set_op_attrs(bio, REQ_OP_WRITE, WRITE_FLUSH_FUA | ff);
++	bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_FUA | ff;
  
  	atomic_inc(&mddev->pending_writes);
  	submit_bio(bio);

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

* linux-next: manual merge of the md tree with the block tree
@ 2016-11-22  4:50 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2016-11-22  4:50 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe
  Cc: linux-next, linux-kernel, Christoph Hellwig, Song Liu

Hi Shaohua,

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

  drivers/md/raid5-cache.c

between commit:

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

from the block tree and commits:

  b4c625c67362 ("md/r5cache: r5cache recovery: part 1")
  3bddb7f8f264 ("md/r5cache: handle FLUSH and FUA")

from the md tree.

I fixed it up (I think - 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 drivers/md/raid5-cache.c
index 2bca090cd64e,8cb79fc0eed9..000000000000
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@@ -231,6 -544,64 +544,64 @@@ static void r5l_log_endio(struct bio *b
  
  	if (log->need_cache_flush)
  		md_wakeup_thread(log->rdev->mddev->thread);
+ 
+ 	if (io->has_null_flush) {
+ 		struct bio *bi;
+ 
+ 		WARN_ON(bio_list_empty(&io->flush_barriers));
+ 		while ((bi = bio_list_pop(&io->flush_barriers)) != NULL) {
+ 			bio_endio(bi);
+ 			atomic_dec(&io->pending_stripe);
+ 		}
+ 		if (atomic_read(&io->pending_stripe) == 0)
+ 			__r5l_stripe_write_finished(io);
+ 	}
+ }
+ 
+ static void r5l_do_submit_io(struct r5l_log *log, struct r5l_io_unit *io)
+ {
+ 	unsigned long flags;
+ 
+ 	spin_lock_irqsave(&log->io_list_lock, flags);
+ 	__r5l_set_io_unit_state(io, IO_UNIT_IO_START);
+ 	spin_unlock_irqrestore(&log->io_list_lock, flags);
+ 
+ 	if (io->has_flush)
 -		bio_set_op_attrs(io->current_bio, REQ_OP_WRITE, WRITE_FLUSH);
++		io->current_bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
+ 	if (io->has_fua)
 -		bio_set_op_attrs(io->current_bio, REQ_OP_WRITE, WRITE_FUA);
++		io->current_bio->bi_opf = REQ_OP_WRITE | REQ_FUA;
+ 	submit_bio(io->current_bio);
+ 
+ 	if (!io->split_bio)
+ 		return;
+ 
+ 	if (io->has_flush)
 -		bio_set_op_attrs(io->split_bio, REQ_OP_WRITE, WRITE_FLUSH);
++		io->split_bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
+ 	if (io->has_fua)
 -		bio_set_op_attrs(io->split_bio, REQ_OP_WRITE, WRITE_FUA);
++		io->split_bio->bi_opf = REQ_OP_WRITE | REQ_FUA;
+ 	submit_bio(io->split_bio);
+ }
+ 
+ /* deferred io_unit will be dispatched here */
+ static void r5l_submit_io_async(struct work_struct *work)
+ {
+ 	struct r5l_log *log = container_of(work, struct r5l_log,
+ 					   deferred_io_work);
+ 	struct r5l_io_unit *io = NULL;
+ 	unsigned long flags;
+ 
+ 	spin_lock_irqsave(&log->io_list_lock, flags);
+ 	if (!list_empty(&log->running_ios)) {
+ 		io = list_first_entry(&log->running_ios, struct r5l_io_unit,
+ 				      log_sibling);
+ 		if (!io->io_deferred)
+ 			io = NULL;
+ 		else
+ 			io->io_deferred = 0;
+ 	}
+ 	spin_unlock_irqrestore(&log->io_list_lock, flags);
+ 	if (io)
+ 		r5l_do_submit_io(log, io);
  }
  
  static void r5l_submit_current_io(struct r5l_log *log)
@@@ -892,82 -1517,138 +1517,138 @@@ static int r5l_recovery_read_meta_block
  	return 0;
  }
  
- static int r5l_recovery_flush_one_stripe(struct r5l_log *log,
- 					 struct r5l_recovery_ctx *ctx,
- 					 sector_t stripe_sect,
- 					 int *offset, sector_t *log_offset)
+ static void
+ r5l_recovery_create_empty_meta_block(struct r5l_log *log,
+ 				     struct page *page,
+ 				     sector_t pos, u64 seq)
  {
- 	struct r5conf *conf = log->rdev->mddev->private;
- 	struct stripe_head *sh;
- 	struct r5l_payload_data_parity *payload;
- 	int disk_index;
+ 	struct r5l_meta_block *mb;
+ 	u32 crc;
  
- 	sh = raid5_get_active_stripe(conf, stripe_sect, 0, 0, 0);
- 	while (1) {
- 		payload = page_address(ctx->meta_page) + *offset;
+ 	mb = page_address(page);
+ 	clear_page(mb);
+ 	mb->magic = cpu_to_le32(R5LOG_MAGIC);
+ 	mb->version = R5LOG_VERSION;
+ 	mb->meta_size = cpu_to_le32(sizeof(struct r5l_meta_block));
+ 	mb->seq = cpu_to_le64(seq);
+ 	mb->position = cpu_to_le64(pos);
+ 	crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
+ 	mb->checksum = cpu_to_le32(crc);
+ }
  
- 		if (le16_to_cpu(payload->header.type) == R5LOG_PAYLOAD_DATA) {
- 			raid5_compute_sector(conf,
- 					     le64_to_cpu(payload->location), 0,
- 					     &disk_index, sh);
+ static int r5l_log_write_empty_meta_block(struct r5l_log *log, sector_t pos,
+ 					  u64 seq)
+ {
+ 	struct page *page;
  
- 			sync_page_io(log->rdev, *log_offset, PAGE_SIZE,
- 				     sh->dev[disk_index].page, REQ_OP_READ, 0,
- 				     false);
- 			sh->dev[disk_index].log_checksum =
- 				le32_to_cpu(payload->checksum[0]);
- 			set_bit(R5_Wantwrite, &sh->dev[disk_index].flags);
- 			ctx->meta_total_blocks += BLOCK_SECTORS;
- 		} else {
- 			disk_index = sh->pd_idx;
- 			sync_page_io(log->rdev, *log_offset, PAGE_SIZE,
- 				     sh->dev[disk_index].page, REQ_OP_READ, 0,
- 				     false);
- 			sh->dev[disk_index].log_checksum =
- 				le32_to_cpu(payload->checksum[0]);
- 			set_bit(R5_Wantwrite, &sh->dev[disk_index].flags);
- 
- 			if (sh->qd_idx >= 0) {
- 				disk_index = sh->qd_idx;
- 				sync_page_io(log->rdev,
- 					     r5l_ring_add(log, *log_offset, BLOCK_SECTORS),
- 					     PAGE_SIZE, sh->dev[disk_index].page,
- 					     REQ_OP_READ, 0, false);
- 				sh->dev[disk_index].log_checksum =
- 					le32_to_cpu(payload->checksum[1]);
- 				set_bit(R5_Wantwrite,
- 					&sh->dev[disk_index].flags);
- 			}
- 			ctx->meta_total_blocks += BLOCK_SECTORS * conf->max_degraded;
- 		}
+ 	page = alloc_page(GFP_KERNEL);
+ 	if (!page)
+ 		return -ENOMEM;
+ 	r5l_recovery_create_empty_meta_block(log, page, pos, seq);
+ 	if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, REQ_OP_WRITE,
 -			  WRITE_FUA, false)) {
++			  REQ_FUA, false)) {
+ 		__free_page(page);
+ 		return -EIO;
+ 	}
+ 	__free_page(page);
+ 	return 0;
+ }
  
- 		*log_offset = r5l_ring_add(log, *log_offset,
- 					   le32_to_cpu(payload->size));
- 		*offset += sizeof(struct r5l_payload_data_parity) +
- 			sizeof(__le32) *
- 			(le32_to_cpu(payload->size) >> (PAGE_SHIFT - 9));
- 		if (le16_to_cpu(payload->header.type) == R5LOG_PAYLOAD_PARITY)
- 			break;
+ /*
+  * r5l_recovery_load_data and r5l_recovery_load_parity uses flag R5_Wantwrite
+  * to mark valid (potentially not flushed) data in the journal.
+  *
+  * We already verified checksum in r5l_recovery_verify_data_checksum_for_mb,
+  * so there should not be any mismatch here.
+  */
+ static void r5l_recovery_load_data(struct r5l_log *log,
+ 				   struct stripe_head *sh,
+ 				   struct r5l_recovery_ctx *ctx,
+ 				   struct r5l_payload_data_parity *payload,
+ 				   sector_t log_offset)
+ {
+ 	struct mddev *mddev = log->rdev->mddev;
+ 	struct r5conf *conf = mddev->private;
+ 	int dd_idx;
+ 
+ 	raid5_compute_sector(conf,
+ 			     le64_to_cpu(payload->location), 0,
+ 			     &dd_idx, sh);
+ 	sync_page_io(log->rdev, log_offset, PAGE_SIZE,
+ 		     sh->dev[dd_idx].page, REQ_OP_READ, 0, false);
+ 	sh->dev[dd_idx].log_checksum =
+ 		le32_to_cpu(payload->checksum[0]);
+ 	ctx->meta_total_blocks += BLOCK_SECTORS;
+ 
+ 	set_bit(R5_Wantwrite, &sh->dev[dd_idx].flags);
+ 	set_bit(STRIPE_R5C_CACHING, &sh->state);
+ }
+ 
+ static void r5l_recovery_load_parity(struct r5l_log *log,
+ 				     struct stripe_head *sh,
+ 				     struct r5l_recovery_ctx *ctx,
+ 				     struct r5l_payload_data_parity *payload,
+ 				     sector_t log_offset)
+ {
+ 	struct mddev *mddev = log->rdev->mddev;
+ 	struct r5conf *conf = mddev->private;
+ 
+ 	ctx->meta_total_blocks += BLOCK_SECTORS * conf->max_degraded;
+ 	sync_page_io(log->rdev, log_offset, PAGE_SIZE,
+ 		     sh->dev[sh->pd_idx].page, REQ_OP_READ, 0, false);
+ 	sh->dev[sh->pd_idx].log_checksum =
+ 		le32_to_cpu(payload->checksum[0]);
+ 	set_bit(R5_Wantwrite, &sh->dev[sh->pd_idx].flags);
+ 
+ 	if (sh->qd_idx >= 0) {
+ 		sync_page_io(log->rdev,
+ 			     r5l_ring_add(log, log_offset, BLOCK_SECTORS),
+ 			     PAGE_SIZE, sh->dev[sh->qd_idx].page,
+ 			     REQ_OP_READ, 0, false);
+ 		sh->dev[sh->qd_idx].log_checksum =
+ 			le32_to_cpu(payload->checksum[1]);
+ 		set_bit(R5_Wantwrite, &sh->dev[sh->qd_idx].flags);
  	}
+ 	clear_bit(STRIPE_R5C_CACHING, &sh->state);
+ }
  
- 	for (disk_index = 0; disk_index < sh->disks; disk_index++) {
- 		void *addr;
- 		u32 checksum;
+ static void r5l_recovery_reset_stripe(struct stripe_head *sh)
+ {
+ 	int i;
  
+ 	sh->state = 0;
+ 	sh->log_start = MaxSector;
+ 	for (i = sh->disks; i--; )
+ 		sh->dev[i].flags = 0;
+ }
+ 
+ static void
+ r5l_recovery_replay_one_stripe(struct r5conf *conf,
+ 			       struct stripe_head *sh,
+ 			       struct r5l_recovery_ctx *ctx)
+ {
+ 	struct md_rdev *rdev, *rrdev;
+ 	int disk_index;
+ 	int data_count = 0;
+ 
+ 	for (disk_index = 0; disk_index < sh->disks; disk_index++) {
  		if (!test_bit(R5_Wantwrite, &sh->dev[disk_index].flags))
  			continue;
- 		addr = kmap_atomic(sh->dev[disk_index].page);
- 		checksum = crc32c_le(log->uuid_checksum, addr, PAGE_SIZE);
- 		kunmap_atomic(addr);
- 		if (checksum != sh->dev[disk_index].log_checksum)
- 			goto error;
+ 		if (disk_index == sh->qd_idx || disk_index == sh->pd_idx)
+ 			continue;
+ 		data_count++;
  	}
  
- 	for (disk_index = 0; disk_index < sh->disks; disk_index++) {
- 		struct md_rdev *rdev, *rrdev;
+ 	/*
+ 	 * stripes that only have parity must have been flushed
+ 	 * before the crash that we are now recovering from, so
+ 	 * there is nothing more to recovery.
+ 	 */
+ 	if (data_count == 0)
+ 		goto out;
  
- 		if (!test_and_clear_bit(R5_Wantwrite,
- 					&sh->dev[disk_index].flags))
+ 	for (disk_index = 0; disk_index < sh->disks; disk_index++) {
+ 		if (!test_bit(R5_Wantwrite, &sh->dev[disk_index].flags))
  			continue;
  
  		/* in case device is broken */
@@@ -1031,31 -1981,158 +1981,158 @@@ static int r5c_recovery_flush_log(struc
  		ctx->seq++;
  		ctx->pos = r5l_ring_add(log, ctx->pos, ctx->meta_total_blocks);
  	}
+ 
+ 	if (ret == -ENOMEM) {
+ 		r5c_recovery_drop_stripes(&ctx->cached_list, ctx);
+ 		return ret;
+ 	}
+ 
+ 	/* replay data-parity stripes */
+ 	r5c_recovery_replay_stripes(&ctx->cached_list, ctx);
+ 
+ 	/* load data-only stripes to stripe cache */
+ 	list_for_each_entry_safe(sh, next, &ctx->cached_list, lru) {
+ 		WARN_ON(!test_bit(STRIPE_R5C_CACHING, &sh->state));
+ 		r5c_recovery_load_one_stripe(log, sh);
+ 		list_del_init(&sh->lru);
+ 		raid5_release_stripe(sh);
+ 		ctx->data_only_stripes++;
+ 	}
+ 
+ 	return 0;
  }
  
- static int r5l_log_write_empty_meta_block(struct r5l_log *log, sector_t pos,
- 					  u64 seq)
+ /*
+  * we did a recovery. Now ctx.pos points to an invalid meta block. New
+  * log will start here. but we can't let superblock point to last valid
+  * meta block. The log might looks like:
+  * | meta 1| meta 2| meta 3|
+  * meta 1 is valid, meta 2 is invalid. meta 3 could be valid. If
+  * superblock points to meta 1, we write a new valid meta 2n.  if crash
+  * happens again, new recovery will start from meta 1. Since meta 2n is
+  * valid now, recovery will think meta 3 is valid, which is wrong.
+  * The solution is we create a new meta in meta2 with its seq == meta
+  * 1's seq + 10 and let superblock points to meta2. The same recovery will
+  * not think meta 3 is a valid meta, because its seq doesn't match
+  */
+ 
+ /*
+  * Before recovery, the log looks like the following
+  *
+  *   ---------------------------------------------
+  *   |           valid log        | invalid log  |
+  *   ---------------------------------------------
+  *   ^
+  *   |- log->last_checkpoint
+  *   |- log->last_cp_seq
+  *
+  * Now we scan through the log until we see invalid entry
+  *
+  *   ---------------------------------------------
+  *   |           valid log        | invalid log  |
+  *   ---------------------------------------------
+  *   ^                            ^
+  *   |- log->last_checkpoint      |- ctx->pos
+  *   |- log->last_cp_seq          |- ctx->seq
+  *
+  * From this point, we need to increase seq number by 10 to avoid
+  * confusing next recovery.
+  *
+  *   ---------------------------------------------
+  *   |           valid log        | invalid log  |
+  *   ---------------------------------------------
+  *   ^                              ^
+  *   |- log->last_checkpoint        |- ctx->pos+1
+  *   |- log->last_cp_seq            |- ctx->seq+11
+  *
+  * However, it is not safe to start the state machine yet, because data only
+  * parities are not yet secured in RAID. To save these data only parities, we
+  * rewrite them from seq+11.
+  *
+  *   -----------------------------------------------------------------
+  *   |           valid log        | data only stripes | invalid log  |
+  *   -----------------------------------------------------------------
+  *   ^                                                ^
+  *   |- log->last_checkpoint                          |- ctx->pos+n
+  *   |- log->last_cp_seq                              |- ctx->seq+10+n
+  *
+  * If failure happens again during this process, the recovery can safe start
+  * again from log->last_checkpoint.
+  *
+  * Once data only stripes are rewritten to journal, we move log_tail
+  *
+  *   -----------------------------------------------------------------
+  *   |     old log        |    data only stripes    | invalid log  |
+  *   -----------------------------------------------------------------
+  *                        ^                         ^
+  *                        |- log->last_checkpoint   |- ctx->pos+n
+  *                        |- log->last_cp_seq       |- ctx->seq+10+n
+  *
+  * Then we can safely start the state machine. If failure happens from this
+  * point on, the recovery will start from new log->last_checkpoint.
+  */
+ static int
+ r5c_recovery_rewrite_data_only_stripes(struct r5l_log *log,
+ 				       struct r5l_recovery_ctx *ctx)
  {
+ 	struct stripe_head *sh;
+ 	struct mddev *mddev = log->rdev->mddev;
  	struct page *page;
- 	struct r5l_meta_block *mb;
- 	u32 crc;
  
- 	page = alloc_page(GFP_KERNEL | __GFP_ZERO);
- 	if (!page)
+ 	page = alloc_page(GFP_KERNEL);
+ 	if (!page) {
+ 		pr_err("md/raid:%s: cannot allocate memory to rewrite data only stripes\n",
+ 		       mdname(mddev));
  		return -ENOMEM;
- 	mb = page_address(page);
- 	mb->magic = cpu_to_le32(R5LOG_MAGIC);
- 	mb->version = R5LOG_VERSION;
- 	mb->meta_size = cpu_to_le32(sizeof(struct r5l_meta_block));
- 	mb->seq = cpu_to_le64(seq);
- 	mb->position = cpu_to_le64(pos);
- 	crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
- 	mb->checksum = cpu_to_le32(crc);
+ 	}
  
- 	if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, REQ_OP_WRITE,
- 			  REQ_FUA, false)) {
- 		__free_page(page);
- 		return -EIO;
+ 	ctx->seq += 10;
+ 	list_for_each_entry(sh, &ctx->cached_list, lru) {
+ 		struct r5l_meta_block *mb;
+ 		int i;
+ 		int offset;
+ 		sector_t write_pos;
+ 
+ 		WARN_ON(!test_bit(STRIPE_R5C_CACHING, &sh->state));
+ 		r5l_recovery_create_empty_meta_block(log, page,
+ 						     ctx->pos, ctx->seq);
+ 		mb = page_address(page);
+ 		offset = le32_to_cpu(mb->meta_size);
+ 		write_pos = ctx->pos + BLOCK_SECTORS;
+ 
+ 		for (i = sh->disks; i--; ) {
+ 			struct r5dev *dev = &sh->dev[i];
+ 			struct r5l_payload_data_parity *payload;
+ 			void *addr;
+ 
+ 			if (test_bit(R5_InJournal, &dev->flags)) {
+ 				payload = (void *)mb + offset;
+ 				payload->header.type = cpu_to_le16(
+ 					R5LOG_PAYLOAD_DATA);
+ 				payload->size = BLOCK_SECTORS;
+ 				payload->location = cpu_to_le64(
+ 					raid5_compute_blocknr(sh, i, 0));
+ 				addr = kmap_atomic(dev->page);
+ 				payload->checksum[0] = cpu_to_le32(
+ 					crc32c_le(log->uuid_checksum, addr,
+ 						  PAGE_SIZE));
+ 				kunmap_atomic(addr);
+ 				sync_page_io(log->rdev, write_pos, PAGE_SIZE,
+ 					     dev->page, REQ_OP_WRITE, 0, false);
+ 				write_pos = r5l_ring_add(log, write_pos,
+ 							 BLOCK_SECTORS);
+ 				offset += sizeof(__le32) +
+ 					sizeof(struct r5l_payload_data_parity);
+ 
+ 			}
+ 		}
+ 		mb->meta_size = cpu_to_le32(offset);
+ 		mb->checksum = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
+ 		sync_page_io(log->rdev, ctx->pos, PAGE_SIZE, page,
 -			     REQ_OP_WRITE, WRITE_FUA, false);
++			     REQ_OP_WRITE, REQ_FUA, false);
+ 		sh->log_start = ctx->pos;
+ 		ctx->pos = write_pos;
+ 		ctx->seq += 1;
  	}
  	__free_page(page);
  	return 0;

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

* linux-next: manual merge of the md tree with the block tree
@ 2016-06-14  3:52 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2016-06-14  3:52 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe; +Cc: linux-next, linux-kernel, Mike Christie, NeilBrown

Hi Shaohua,

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

  drivers/md/raid1.c

between commit:

  796a5cf083c2 ("md: use bio op accessors")

from the block tree and commit:

  707a6a420ccf ("md/raid1: add rcu protection to rdev in fix_read_error")

from the md 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 drivers/md/raid1.c
index 41d9c31da3b3,5027ef4752ac..000000000000
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@@ -2086,15 -2069,20 +2067,21 @@@ static void fix_read_error(struct r1con
  			     (!test_bit(Faulty, &rdev->flags) &&
  			      rdev->recovery_offset >= sect + s)) &&
  			    is_badblock(rdev, sect, s,
- 					&first_bad, &bad_sectors) == 0 &&
- 			    sync_page_io(rdev, sect, s<<9,
- 					 conf->tmppage, REQ_OP_READ, 0, false))
- 				success = 1;
- 			else {
- 				d++;
- 				if (d == conf->raid_disks * 2)
- 					d = 0;
- 			}
+ 					&first_bad, &bad_sectors) == 0) {
+ 				atomic_inc(&rdev->nr_pending);
+ 				rcu_read_unlock();
+ 				if (sync_page_io(rdev, sect, s<<9,
 -						 conf->tmppage, READ, false))
++						 conf->tmppage, REQ_OP_READ, 0,
++						 false))
+ 					success = 1;
+ 				rdev_dec_pending(rdev, mddev);
+ 				if (success)
+ 					break;
+ 			} else
+ 				rcu_read_unlock();
+ 			d++;
+ 			if (d == conf->raid_disks * 2)
+ 				d = 0;
  		} while (!success && d != read_disk);
  
  		if (!success) {

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

* linux-next: manual merge of the md tree with the block tree
@ 2016-06-14  3:52 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2016-06-14  3:52 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe; +Cc: linux-next, linux-kernel, Mike Christie, NeilBrown

Hi Shaohua,

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

  drivers/md/raid10.c

between commit:

  796a5cf083c2 ("md: use bio op accessors")

from the block tree and commits:

  f90145f317ef ("md/raid10: add rcu protection to rdev access in raid10_sync_request."
  d094d6860b66 ("md/raid10: add rcu protection to rdev access during reshape.")

from the md 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 drivers/md/raid10.c
index 26ae74fd0d01,8ee5d96e6a2d..000000000000
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@@ -3063,10 -3092,10 +3091,10 @@@ static sector_t raid10_sync_request(str
  					biolist = bio;
  					bio->bi_private = r10_bio;
  					bio->bi_end_io = end_sync_write;
 -					bio->bi_rw = WRITE;
 +					bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
  					bio->bi_iter.bi_sector = to_addr
- 						+ rdev->data_offset;
- 					bio->bi_bdev = rdev->bdev;
+ 						+ mrdev->data_offset;
+ 					bio->bi_bdev = mrdev->bdev;
  					atomic_inc(&r10_bio->remaining);
  				} else
  					r10_bio->devs[1].bio->bi_end_io = NULL;
@@@ -3092,10 -3120,10 +3119,10 @@@
  				biolist = bio;
  				bio->bi_private = r10_bio;
  				bio->bi_end_io = end_sync_write;
 -				bio->bi_rw = WRITE;
 +				bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
  				bio->bi_iter.bi_sector = to_addr +
- 					rdev->data_offset;
- 				bio->bi_bdev = rdev->bdev;
+ 					mreplace->data_offset;
+ 				bio->bi_bdev = mreplace->bdev;
  				atomic_inc(&r10_bio->remaining);
  				break;
  			}
@@@ -3212,16 -3251,18 +3250,18 @@@
  			biolist = bio;
  			bio->bi_private = r10_bio;
  			bio->bi_end_io = end_sync_read;
 -			bio->bi_rw = READ;
 +			bio_set_op_attrs(bio, REQ_OP_READ, 0);
- 			bio->bi_iter.bi_sector = sector +
- 				conf->mirrors[d].rdev->data_offset;
- 			bio->bi_bdev = conf->mirrors[d].rdev->bdev;
+ 			bio->bi_iter.bi_sector = sector + rdev->data_offset;
+ 			bio->bi_bdev = rdev->bdev;
  			count++;
  
- 			if (conf->mirrors[d].replacement == NULL ||
- 			    test_bit(Faulty,
- 				     &conf->mirrors[d].replacement->flags))
+ 			rdev = rcu_dereference(conf->mirrors[d].replacement);
+ 			if (rdev == NULL || test_bit(Faulty, &rdev->flags)) {
+ 				rcu_read_unlock();
  				continue;
+ 			}
+ 			atomic_inc(&rdev->nr_pending);
+ 			rcu_read_unlock();
  
  			/* Need to set up for writing to the replacement */
  			bio = r10_bio->devs[i].repl_bio;
@@@ -3234,10 -3274,9 +3273,9 @@@
  			biolist = bio;
  			bio->bi_private = r10_bio;
  			bio->bi_end_io = end_sync_write;
 -			bio->bi_rw = WRITE;
 +			bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
- 			bio->bi_iter.bi_sector = sector +
- 				conf->mirrors[d].replacement->data_offset;
- 			bio->bi_bdev = conf->mirrors[d].replacement->bdev;
+ 			bio->bi_iter.bi_sector = sector + rdev->data_offset;
+ 			bio->bi_bdev = rdev->bdev;
  			count++;
  		}
  
@@@ -4521,7 -4569,9 +4568,9 @@@ static int handle_reshape_read_error(st
  					       addr,
  					       s << 9,
  					       bvec[idx].bv_page,
 -					       READ, false);
 +					       REQ_OP_READ, 0, false);
+ 			rdev_dec_pending(rdev, mddev);
+ 			rcu_read_lock();
  			if (success)
  				break;
  		failed:

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

* linux-next: manual merge of the md tree with the block tree
@ 2015-08-17  4:44 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2015-08-17  4:44 UTC (permalink / raw)
  To: Neil Brown, Jens Axboe; +Cc: linux-next, linux-kernel, Kent Overstreet

Hi Neil,

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

  drivers/md/raid0.c

between commit:

  8ae126660fdd ("block: kill merge_bvec_fn() completely")

from the block tree and commit:

  927d881980b7 ("md/raid0: update queue parameter in a safer location.")

from the md tree.

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

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

diff --cc drivers/md/raid0.c
index 59cda501a224,4a13c3cb940b..000000000000
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@@ -188,10 -203,9 +203,6 @@@ static int create_strip_zones(struct md
  		}
  		dev[j] = rdev1;
  
- 		if (mddev->queue)
- 			disk_stack_limits(mddev->gendisk, rdev1->bdev,
- 					  rdev1->data_offset << 9);
 -		if (rdev1->bdev->bd_disk->queue->merge_bvec_fn)
 -			conf->has_merge_bvec = 1;
--
  		if (!smallest || (rdev1->sectors < smallest->sectors))
  			smallest = rdev1;
  		cnt++;

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

* linux-next: manual merge of the md tree with the block tree
@ 2015-08-17  4:44 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2015-08-17  4:44 UTC (permalink / raw)
  To: Neil Brown, Jens Axboe; +Cc: linux-next, linux-kernel, Christoph Hellwig

Hi Neil,

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

  drivers/md/raid10.c

between commit:

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

from the block tree and commit:

  90421c7cfde6 ("md/raid10: ensure device failure recorded before write request returns.")

from the md tree.

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

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

diff --cc drivers/md/raid10.c
index b0fce2ebf7ad,a14c304aa751..000000000000
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@@ -2633,7 -2750,9 +2635,8 @@@ static void handle_write_completed(stru
  					r10_bio->devs[m].addr,
  					r10_bio->sectors, 0);
  				rdev_dec_pending(rdev, conf->mddev);
 -			} else if (bio != NULL &&
 -				   !test_bit(BIO_UPTODATE, &bio->bi_flags)) {
 +			} else if (bio != NULL && bio->bi_error) {
+ 				fail = true;
  				if (!narrow_write_error(r10_bio, m)) {
  					md_error(conf->mddev, rdev);
  					set_bit(R10BIO_Degraded,

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

* linux-next: manual merge of the md tree with the block tree
@ 2015-08-17  4:44 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2015-08-17  4:44 UTC (permalink / raw)
  To: Neil Brown, Jens Axboe
  Cc: linux-next, linux-kernel, Christoph Hellwig, Kent Overstreet

Hi Neil,

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

  drivers/md/raid5.c

between commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")
  8ae126660fdd ("block: kill merge_bvec_fn() completely")

from the block tree and commit:

  1722781be955 ("md/raid5: switch to use conf->chunk_sectors in place of mddev->chunk_sectors where possible")
  4273c3f9d668 ("md/raid5: use bio_list for the list of bios to return.")

from the md tree.

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

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

diff --cc drivers/md/raid5.c
index b29e89cb815b,4195064460d0..000000000000
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@@ -233,8 -230,7 +230,7 @@@ static void return_io(struct bio_list *
  		bi->bi_iter.bi_size = 0;
  		trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
  					 bi, 0);
 -		bio_endio(bi, 0);
 +		bio_endio(bi);
- 		bi = return_bi;
  	}
  }
  
@@@ -3110,12 -3107,10 +3105,11 @@@ handle_failed_stripe(struct r5conf *con
  		while (bi && bi->bi_iter.bi_sector <
  			sh->dev[i].sector + STRIPE_SECTORS) {
  			struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector);
 -			clear_bit(BIO_UPTODATE, &bi->bi_flags);
 +
 +			bi->bi_error = -EIO;
  			if (!raid5_dec_bi_active_stripes(bi)) {
  				md_write_end(conf->mddev);
- 				bi->bi_next = *return_bi;
- 				*return_bi = bi;
+ 				bio_list_add(return_bi, bi);
  			}
  			bi = nextbi;
  		}
@@@ -3135,12 -3130,10 +3129,11 @@@
  		while (bi && bi->bi_iter.bi_sector <
  		       sh->dev[i].sector + STRIPE_SECTORS) {
  			struct bio *bi2 = r5_next_bio(bi, sh->dev[i].sector);
 -			clear_bit(BIO_UPTODATE, &bi->bi_flags);
 +
 +			bi->bi_error = -EIO;
  			if (!raid5_dec_bi_active_stripes(bi)) {
  				md_write_end(conf->mddev);
- 				bi->bi_next = *return_bi;
- 				*return_bi = bi;
+ 				bio_list_add(return_bi, bi);
  			}
  			bi = bi2;
  		}
@@@ -3161,12 -3154,9 +3154,10 @@@
  			       sh->dev[i].sector + STRIPE_SECTORS) {
  				struct bio *nextbi =
  					r5_next_bio(bi, sh->dev[i].sector);
 -				clear_bit(BIO_UPTODATE, &bi->bi_flags);
 +
 +				bi->bi_error = -EIO;
- 				if (!raid5_dec_bi_active_stripes(bi)) {
- 					bi->bi_next = *return_bi;
- 					*return_bi = bi;
- 				}
+ 				if (!raid5_dec_bi_active_stripes(bi))
+ 					bio_list_add(return_bi, bi);
  				bi = nextbi;
  			}
  		}
@@@ -4670,14 -4667,43 +4668,14 @@@ static int raid5_congested(struct mdde
  	return 0;
  }
  
 -/* We want read requests to align with chunks where possible,
 - * but write requests don't need to.
 - */
 -static int raid5_mergeable_bvec(struct mddev *mddev,
 -				struct bvec_merge_data *bvm,
 -				struct bio_vec *biovec)
 -{
 -	struct r5conf *conf = mddev->private;
 -	sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
 -	int max;
 -	unsigned int chunk_sectors;
 -	unsigned int bio_sectors = bvm->bi_size >> 9;
 -
 -	/*
 -	 * always allow writes to be mergeable, read as well if array
 -	 * is degraded as we'll go through stripe cache anyway.
 -	 */
 -	if ((bvm->bi_rw & 1) == WRITE || mddev->degraded)
 -		return biovec->bv_len;
 -
 -	chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
 -	max =  (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9;
 -	if (max < 0) max = 0;
 -	if (max <= biovec->bv_len && bio_sectors == 0)
 -		return biovec->bv_len;
 -	else
 -		return max;
 -}
 -
  static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
  {
+ 	struct r5conf *conf = mddev->private;
  	sector_t sector = bio->bi_iter.bi_sector + get_start_sect(bio->bi_bdev);
- 	unsigned int chunk_sectors = mddev->chunk_sectors;
+ 	unsigned int chunk_sectors;
  	unsigned int bio_sectors = bio_sectors(bio);
  
- 	if (mddev->new_chunk_sectors < mddev->chunk_sectors)
- 		chunk_sectors = mddev->new_chunk_sectors;
+ 	chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
  	return  chunk_sectors >=
  		((sector & (chunk_sectors - 1)) + bio_sectors);
  }

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

* linux-next: manual merge of the md tree with the block tree
@ 2012-09-21  2:49 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2012-09-21  2:49 UTC (permalink / raw)
  To: Neil Brown
  Cc: linux-next, linux-kernel, Martin K. Petersen, Jens Axboe, Shaohua Li

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

Hi Neil,

Today's linux-next merge of the md tree got a conflict in
drivers/md/raid0.c between commit 4363ac7c13a9 ("block: Implement support
for WRITE SAME") from the block tree and commit c9264cda8f11 ("md: raid 0
supports TRIM") from the md tree.

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

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

diff --cc drivers/md/raid0.c
index a9e4fa9,1a8e5e3..0000000
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@@ -422,7 -431,7 +431,8 @@@ static int raid0_run(struct mddev *mdde
  	if (md_check_no_bitmap(mddev))
  		return -EINVAL;
  	blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
 +	blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
+ 	blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
  
  	/* if private is not null, we are here after takeover */
  	if (mddev->private == NULL) {

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

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

* linux-next: manual merge of the md tree with the block tree
@ 2011-10-07  3:06 Stephen Rothwell
  0 siblings, 0 replies; 17+ messages in thread
From: Stephen Rothwell @ 2011-10-07  3:06 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-next, linux-kernel, Christoph Hellwig, Jens Axboe

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

Hi Neil,

Today's linux-next merge of the md tree got conflicts in
drivers/md/faulty.c, drivers/md/linear.c, drivers/md/md.c,
drivers/md/md.h, drivers/md/multipath.c, drivers/md/raid0.c,
drivers/md/raid1.c, drivers/md/raid10.c and drivers/md/raid5.c between
commit 5a7bbad27a41 ("block: remove support for bio remapping from
->make_request") from the block tree and commit 546208fc263c ("md: remove
typedefs: mddev_t -> struct mddev") from the md tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/md/faulty.c
index 5ef304d,571445e..0000000
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@@ -169,9 -169,9 +169,9 @@@ static void add_sector(struct faulty_co
  		conf->nfaults = n+1;
  }
  
- static void make_request(mddev_t *mddev, struct bio *bio)
 -static int make_request(struct mddev *mddev, struct bio *bio)
++static void make_request(struct mddev *mddev, struct bio *bio)
  {
- 	conf_t *conf = mddev->private;
+ 	struct faulty_conf *conf = mddev->private;
  	int failit = 0;
  
  	if (bio_data_dir(bio) == WRITE) {
@@@ -215,16 -214,17 +215,16 @@@
  		b->bi_bdev = conf->rdev->bdev;
  		b->bi_private = bio;
  		b->bi_end_io = faulty_fail;
 -		generic_make_request(b);
 -		return 0;
 -	} else {
 +		bio = b;
 +	} else
  		bio->bi_bdev = conf->rdev->bdev;
 -		return 1;
 -	}
 +
 +	generic_make_request(bio);
  }
  
- static void status(struct seq_file *seq, mddev_t *mddev)
+ static void status(struct seq_file *seq, struct mddev *mddev)
  {
- 	conf_t *conf = mddev->private;
+ 	struct faulty_conf *conf = mddev->private;
  	int n;
  
  	if ((n=atomic_read(&conf->counters[WriteTransient])) != 0)
diff --cc drivers/md/linear.c
index c6ee491,cbac48c..0000000
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@@ -264,9 -264,9 +264,9 @@@ static int linear_stop (struct mddev *m
  	return 0;
  }
  
- static void linear_make_request (mddev_t *mddev, struct bio *bio)
 -static int linear_make_request (struct mddev *mddev, struct bio *bio)
++static void linear_make_request (struct mddev *mddev, struct bio *bio)
  {
- 	dev_info_t *tmp_dev;
+ 	struct dev_info *tmp_dev;
  	sector_t start_sector;
  
  	if (unlikely(bio->bi_rw & REQ_FLUSH)) {
@@@ -317,10 -319,11 +317,10 @@@
  	bio->bi_sector = bio->bi_sector - start_sector
  		+ tmp_dev->rdev->data_offset;
  	rcu_read_unlock();
 -
 -	return 1;
 +	generic_make_request(bio);
  }
  
- static void linear_status (struct seq_file *seq, mddev_t *mddev)
+ static void linear_status (struct seq_file *seq, struct mddev *mddev)
  {
  
  	seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2);
diff --cc drivers/md/md.c
index 8f52d4e,f8ed97d..0000000
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@@ -335,10 -332,11 +332,10 @@@ static DEFINE_SPINLOCK(all_mddevs_lock)
   * call has finished, the bio has been linked into some internal structure
   * and so is visible to ->quiesce(), so we don't need the refcount any more.
   */
 -static int md_make_request(struct request_queue *q, struct bio *bio)
 +static void md_make_request(struct request_queue *q, struct bio *bio)
  {
  	const int rw = bio_data_dir(bio);
- 	mddev_t *mddev = q->queuedata;
+ 	struct mddev *mddev = q->queuedata;
 -	int rv;
  	int cpu;
  	unsigned int sectors;
  
diff --cc drivers/md/md.h
index 1509a3e,b618da5..0000000
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@@ -424,10 -419,10 +419,10 @@@ struct mdk_personalit
  	int level;
  	struct list_head list;
  	struct module *owner;
- 	void (*make_request)(mddev_t *mddev, struct bio *bio);
- 	int (*run)(mddev_t *mddev);
- 	int (*stop)(mddev_t *mddev);
- 	void (*status)(struct seq_file *seq, mddev_t *mddev);
 -	int (*make_request)(struct mddev *mddev, struct bio *bio);
++	void (*make_request)(struct mddev *mddev, struct bio *bio);
+ 	int (*run)(struct mddev *mddev);
+ 	int (*stop)(struct mddev *mddev);
+ 	void (*status)(struct seq_file *seq, struct mddev *mddev);
  	/* error_handler must set ->faulty and clear ->in_sync
  	 * if appropriate, and should abort recovery if needed 
  	 */
diff --cc drivers/md/multipath.c
index 618dd9e,9650593..0000000
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@@ -106,9 -106,9 +106,9 @@@ static void multipath_end_request(struc
  	rdev_dec_pending(rdev, conf->mddev);
  }
  
- static void multipath_make_request(mddev_t *mddev, struct bio * bio)
 -static int multipath_make_request(struct mddev *mddev, struct bio * bio)
++static void multipath_make_request(struct mddev *mddev, struct bio * bio)
  {
- 	multipath_conf_t *conf = mddev->private;
+ 	struct mpconf *conf = mddev->private;
  	struct multipath_bh * mp_bh;
  	struct multipath_info *multipath;
  
@@@ -137,12 -137,12 +137,12 @@@
  	mp_bh->bio.bi_end_io = multipath_end_request;
  	mp_bh->bio.bi_private = mp_bh;
  	generic_make_request(&mp_bh->bio);
 -	return 0;
 +	return;
  }
  
- static void multipath_status (struct seq_file *seq, mddev_t *mddev)
+ static void multipath_status (struct seq_file *seq, struct mddev *mddev)
  {
- 	multipath_conf_t *conf = mddev->private;
+ 	struct mpconf *conf = mddev->private;
  	int i;
  	
  	seq_printf (seq, " [%d/%d] [", conf->raid_disks,
diff --cc drivers/md/raid0.c
index 4066615,38a9012..0000000
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@@ -466,7 -468,7 +468,7 @@@ static inline int is_io_in_chunk_bounda
  	}
  }
  
- static void raid0_make_request(mddev_t *mddev, struct bio *bio)
 -static int raid0_make_request(struct mddev *mddev, struct bio *bio)
++static void raid0_make_request(struct mddev *mddev, struct bio *bio)
  {
  	unsigned int chunk_sects;
  	sector_t sector_offset;
@@@ -519,38 -525,11 +521,11 @@@ bad_map
  	       (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
  
  	bio_io_error(bio);
 -	return 0;
 +	return;
  }
  
- static void raid0_status(struct seq_file *seq, mddev_t *mddev)
+ static void raid0_status(struct seq_file *seq, struct mddev *mddev)
  {
- #undef MD_DEBUG
- #ifdef MD_DEBUG
- 	int j, k, h;
- 	char b[BDEVNAME_SIZE];
- 	raid0_conf_t *conf = mddev->private;
- 	int raid_disks = conf->strip_zone[0].nb_dev;
- 
- 	sector_t zone_size;
- 	sector_t zone_start = 0;
- 	h = 0;
- 
- 	for (j = 0; j < conf->nr_strip_zones; j++) {
- 		seq_printf(seq, "      z%d", j);
- 		seq_printf(seq, "=[");
- 		for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
- 			seq_printf(seq, "%s/", bdevname(
- 				conf->devlist[j*raid_disks + k]
- 						->bdev, b));
- 
- 		zone_size  = conf->strip_zone[j].zone_end - zone_start;
- 		seq_printf(seq, "] ze=%lld ds=%lld s=%lld\n",
- 			(unsigned long long)zone_start>>1,
- 			(unsigned long long)conf->strip_zone[j].dev_start>>1,
- 			(unsigned long long)zone_size>>1);
- 		zone_start = conf->strip_zone[j].zone_end;
- 	}
- #endif
  	seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
  	return;
  }
diff --cc drivers/md/raid1.c
index d4ddfa6,e09f595..0000000
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@@ -782,14 -793,14 +793,14 @@@ do_sync_io
  		if (bvecs[i].bv_page)
  			put_page(bvecs[i].bv_page);
  	kfree(bvecs);
- 	PRINTK("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
+ 	pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
  }
  
- static void make_request(mddev_t *mddev, struct bio * bio)
 -static int make_request(struct mddev *mddev, struct bio * bio)
++static void make_request(struct mddev *mddev, struct bio * bio)
  {
- 	conf_t *conf = mddev->private;
- 	mirror_info_t *mirror;
- 	r1bio_t *r1_bio;
+ 	struct r1conf *conf = mddev->private;
+ 	struct mirror_info *mirror;
+ 	struct r1bio *r1_bio;
  	struct bio *read_bio;
  	int i, disks;
  	struct bitmap *bitmap;
@@@ -1123,11 -1134,13 +1134,11 @@@ read_again
  
  	if (do_sync || !bitmap || !plugged)
  		md_wakeup_thread(mddev->thread);
 -
 -	return 0;
  }
  
- static void status(struct seq_file *seq, mddev_t *mddev)
+ static void status(struct seq_file *seq, struct mddev *mddev)
  {
- 	conf_t *conf = mddev->private;
+ 	struct r1conf *conf = mddev->private;
  	int i;
  
  	seq_printf(seq, " [%d/%d] [", conf->raid_disks,
diff --cc drivers/md/raid10.c
index ea5fc0b,7ba9742..0000000
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@@ -830,11 -830,11 +830,11 @@@ static void unfreeze_array(struct r10co
  	spin_unlock_irq(&conf->resync_lock);
  }
  
- static void make_request(mddev_t *mddev, struct bio * bio)
 -static int make_request(struct mddev *mddev, struct bio * bio)
++static void make_request(struct mddev *mddev, struct bio * bio)
  {
- 	conf_t *conf = mddev->private;
- 	mirror_info_t *mirror;
- 	r10bio_t *r10_bio;
+ 	struct r10conf *conf = mddev->private;
+ 	struct mirror_info *mirror;
+ 	struct r10bio *r10_bio;
  	struct bio *read_bio;
  	int i;
  	int chunk_sects = conf->chunk_mask + 1;
@@@ -1156,11 -1158,12 +1156,11 @@@ retry_write
  
  	if (do_sync || !mddev->bitmap || !plugged)
  		md_wakeup_thread(mddev->thread);
 -	return 0;
  }
  
- static void status(struct seq_file *seq, mddev_t *mddev)
+ static void status(struct seq_file *seq, struct mddev *mddev)
  {
- 	conf_t *conf = mddev->private;
+ 	struct r10conf *conf = mddev->private;
  	int i;
  
  	if (conf->near_copies < conf->raid_disks)
diff --cc drivers/md/raid5.c
index 83f2c44,921e966..0000000
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@@ -3695,9 -3688,9 +3688,9 @@@ static struct stripe_head *__get_priori
  	return sh;
  }
  
- static void make_request(mddev_t *mddev, struct bio * bi)
 -static int make_request(struct mddev *mddev, struct bio * bi)
++static void make_request(struct mddev *mddev, struct bio * bi)
  {
- 	raid5_conf_t *conf = mddev->private;
+ 	struct r5conf *conf = mddev->private;
  	int dd_idx;
  	sector_t new_sector;
  	sector_t logical_sector, last_sector;
@@@ -3851,11 -3844,13 +3844,11 @@@
  
  		bio_endio(bi, 0);
  	}
 -
 -	return 0;
  }
  
- static sector_t raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks);
+ static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
  
- static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped)
+ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, int *skipped)
  {
  	/* reshaping is quite different to recovery/resync so it is
  	 * handled quite separately ... here.

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

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

end of thread, other threads:[~2018-05-31  4:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15  4:07 linux-next: manual merge of the md tree with the block tree Stephen Rothwell
2014-01-15  5:30 ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2018-05-31  4:34 Stephen Rothwell
2017-08-29  4:13 Stephen Rothwell
2017-06-13  4:33 Stephen Rothwell
2017-04-12  2:31 Stephen Rothwell
2017-04-10  2:08 Stephen Rothwell
2017-04-10  2:03 Stephen Rothwell
2016-11-23  2:17 Stephen Rothwell
2016-11-22  4:50 Stephen Rothwell
2016-06-14  3:52 Stephen Rothwell
2016-06-14  3:52 Stephen Rothwell
2015-08-17  4:44 Stephen Rothwell
2015-08-17  4:44 Stephen Rothwell
2015-08-17  4:44 Stephen Rothwell
2012-09-21  2:49 Stephen Rothwell
2011-10-07  3:06 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).