linux-next: manual merge of the device-mapper tree with the block tree

2020-07-08 Thread Stephen Rothwell
Hi all,

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

  drivers/md/dm-crypt.c

between commit:

  ed00aabd5eb9 ("block: rename generic_make_request to submit_bio_noacct")

from the block tree and commit:

  202b8d712016 ("dm crypt: add flags to optionally bypass kcryptd workqueues")

from the device-mapper 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/dm-crypt.c
index b437a14c4942,bad05c5ed3b5..
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@@ -1892,8 -1896,9 +1896,9 @@@ static void kcryptd_crypt_write_io_subm
  
clone->bi_iter.bi_sector = cc->start + io->sector;
  
-   if (likely(!async) && test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags)) {
+   if ((likely(!async) && test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags)) ||
+   test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags)) {
 -  generic_make_request(clone);
 +  submit_bio_noacct(clone);
return;
}
  


pgpMJ1MBwne0p.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the device-mapper tree with the block tree

2020-05-21 Thread Stephen Rothwell
Hi all,

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

  drivers/md/dm-zoned-metadata.c

between commit:

  c64644ce363b ("block: remove the error_sector argument to blkdev_issue_flush")

from the block tree and commit:

  bf28a3ba0986 ("dm zoned: store device in struct dmz_sb")

from the device-mapper 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/dm-zoned-metadata.c
index bf2245370305,db0dc2b5d44d..
--- a/drivers/md/dm-zoned-metadata.c
+++ b/drivers/md/dm-zoned-metadata.c
@@@ -659,9 -816,10 +816,10 @@@ static int dmz_write_sb(struct dmz_meta
sb->crc = 0;
sb->crc = cpu_to_le32(crc32_le(sb_gen, (unsigned char *)sb, 
DMZ_BLOCK_SIZE));
  
-   ret = dmz_rdwr_block(zmd, REQ_OP_WRITE, block, mblk->page);
+   ret = dmz_rdwr_block(dev, REQ_OP_WRITE, zmd->sb[set].block,
+mblk->page);
if (ret == 0)
-   ret = blkdev_issue_flush(zmd->dev->bdev, GFP_NOIO);
 -  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO, NULL);
++  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO);
  
return ret;
  }
@@@ -703,7 -862,7 +862,7 @@@ static int dmz_write_dirty_mblocks(stru
  
/* Flush drive cache (this will also sync data) */
if (ret == 0)
-   ret = blkdev_issue_flush(zmd->dev->bdev, GFP_NOIO);
 -  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO, NULL);
++  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO);
  
return ret;
  }
@@@ -772,7 -933,7 +933,7 @@@ int dmz_flush_metadata(struct dmz_metad
  
/* If there are no dirty metadata blocks, just flush the device cache */
if (list_empty(&write_list)) {
-   ret = blkdev_issue_flush(zmd->dev->bdev, GFP_NOIO);
 -  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO, NULL);
++  ret = blkdev_issue_flush(dev->bdev, GFP_NOIO);
goto err;
}
  


pgpSZHCh8TIRK.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the device-mapper tree with the block tree

2018-12-09 Thread Mike Snitzer
On Sun, Dec 09 2018 at 10:55pm -0500,
Jens Axboe  wrote:

> On 12/9/18 8:43 PM, Stephen Rothwell wrote:
> > Hi all,
> > 
> > It appears that there are a series of shared patches between the block
> > and device-mapper trees that are not the same commits.  I assume that the
> > block tree has been rebased, while the device mapper tree that was based
> > (or includes) part of the block tree has not bee rebased (yet).
> 
> Yep that's my fault, due to a stupid mistake I had to rebase the
> block tree. Didn't realize that Mike's tree was based on it. Mike,
> would it be a big issue for you to rebase the dm tree?

No problem, just did it and pushed to linux-dm.git's for-next.
(I was already anticipating rebasing dm's for-next again once the
bio-based percpu in_flight was merged into linux-block, hopefully we can
get that to land)


Re: linux-next: manual merge of the device-mapper tree with the block tree

2018-12-09 Thread Jens Axboe
On 12/9/18 8:43 PM, Stephen Rothwell wrote:
> Hi all,
> 
> It appears that there are a series of shared patches between the block
> and device-mapper trees that are not the same commits.  I assume that the
> block tree has been rebased, while the device mapper tree that was based
> (or includes) part of the block tree has not bee rebased (yet).

Yep that's my fault, due to a stupid mistake I had to rebase the
block tree. Didn't realize that Mike's tree was based on it. Mike,
would it be a big issue for you to rebase the dm tree?

-- 
Jens Axboe



linux-next: manual merge of the device-mapper tree with the block tree

2018-12-09 Thread Stephen Rothwell
Hi all,

It appears that there are a series of shared patches between the block
and device-mapper trees that are not the same commits.  I assume that the
block tree has been rebased, while the device mapper tree that was based
(or includes) part of the block tree has not bee rebased (yet).

-- 
Cheers,
Stephen Rothwell


pgpOG9v9r_ggG.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the device-mapper tree with the block tree

2016-07-20 Thread Stephen Rothwell
Hi all,

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

  drivers/md/dm.c

between commit:

  4cc96131afce ("dm: move request-based code out to dm-rq.[hc]")

from the block tree and commit:

  70246286e94c ("block: get rid of bio_rw and READA")

from the device-mapper 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/dm.c
index 812fd5984eea,4dca5a792e4b..
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@@ -1684,512 -1141,165 +1141,165 @@@ static unsigned get_num_write_same_bios
return ti->num_write_same_bios;
  }
  
- typedef bool (*is_split_required_fn)(struct dm_target *ti);
- 
- static bool is_split_required_for_discard(struct dm_target *ti)
- {
-   return ti->split_discard_bios;
- }
- 
- static int __send_changing_extent_only(struct clone_info *ci,
-  get_num_bios_fn get_num_bios,
-  is_split_required_fn is_split_required)
- {
-   struct dm_target *ti;
-   unsigned len;
-   unsigned num_bios;
- 
-   do {
-   ti = dm_table_find_target(ci->map, ci->sector);
-   if (!dm_target_is_valid(ti))
-   return -EIO;
- 
-   /*
-* Even though the device advertised support for this type of
-* request, that does not mean every target supports it, and
-* reconfiguration might also have changed that since the
-* check was performed.
-*/
-   num_bios = get_num_bios ? get_num_bios(ti) : 0;
-   if (!num_bios)
-   return -EOPNOTSUPP;
- 
-   if (is_split_required && !is_split_required(ti))
-   len = min((sector_t)ci->sector_count, 
max_io_len_target_boundary(ci->sector, ti));
-   else
-   len = min((sector_t)ci->sector_count, 
max_io_len(ci->sector, ti));
- 
-   __send_duplicate_bios(ci, ti, num_bios, &len);
- 
-   ci->sector += len;
-   } while (ci->sector_count -= len);
- 
-   return 0;
- }
- 
- static int __send_discard(struct clone_info *ci)
- {
-   return __send_changing_extent_only(ci, get_num_discard_bios,
-  is_split_required_for_discard);
- }
- 
- static int __send_write_same(struct clone_info *ci)
- {
-   return __send_changing_extent_only(ci, get_num_write_same_bios, NULL);
- }
- 
- /*
-  * Select the correct strategy for processing a non-flush bio.
-  */
- static int __split_and_process_non_flush(struct clone_info *ci)
- {
-   struct bio *bio = ci->bio;
-   struct dm_target *ti;
-   unsigned len;
-   int r;
- 
-   if (unlikely(bio_op(bio) == REQ_OP_DISCARD))
-   return __send_discard(ci);
-   else if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME))
-   return __send_write_same(ci);
- 
-   ti = dm_table_find_target(ci->map, ci->sector);
-   if (!dm_target_is_valid(ti))
-   return -EIO;
- 
-   len = min_t(sector_t, max_io_len(ci->sector, ti), ci->sector_count);
- 
-   r = __clone_and_map_data_bio(ci, ti, ci->sector, &len);
-   if (r < 0)
-   return r;
- 
-   ci->sector += len;
-   ci->sector_count -= len;
- 
-   return 0;
- }
- 
- /*
-  * Entry point to split a bio into clones and submit them to the targets.
-  */
- static void __split_and_process_bio(struct mapped_device *md,
-   struct dm_table *map, struct bio *bio)
- {
-   struct clone_info ci;
-   int error = 0;
- 
-   if (unlikely(!map)) {
-   bio_io_error(bio);
-   return;
-   }
- 
-   ci.map = map;
-   ci.md = md;
-   ci.io = alloc_io(md);
-   ci.io->error = 0;
-   atomic_set(&ci.io->io_count, 1);
-   ci.io->bio = bio;
-   ci.io->md = md;
-   spin_lock_init(&ci.io->endio_lock);
-   ci.sector = bio->bi_iter.bi_sector;
- 
-   start_io_acct(ci.io);
- 
-   if (bio->bi_rw & REQ_PREFLUSH) {
-   ci.bio = &ci.md->flush_bio;
-   ci.sector_count = 0;
-   error = __send_empty_flush(&ci);
-   /* dec_pending submits any data associated with flush */
-   } else {
-   ci.bio = bio;
-   ci.sector_count = bio_sectors(bio);
-   while (ci.sector_count && !error)
-   error = __split_and_process_non_flush(&ci);
-   }
- 
-   /* drop the extra reference count */
-   dec_pending(ci.io, error);
- }
- /*---

linux-next: manual merge of the device-mapper tree with the block tree

2016-07-17 Thread Stephen Rothwell
Hi all,

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

  include/linux/blkdev.h

between commit:

  288dab8a35a0 ("block: add a separate operation type for secure erase")

from the block tree and commit:

  ff6bbdd8ef75 ("block: add QUEUE_FLAG_DAX for devices to advertise their DAX 
support")

from the device-mapper 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 include/linux/blkdev.h
index 9ae49ccaac95,1493ab3a537f..
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@@ -592,8 -593,9 +593,9 @@@ static inline void queue_flag_clear(uns
  #define blk_queue_stackable(q)\
test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
  #define blk_queue_discard(q)  test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)
 -#define blk_queue_secdiscard(q)   (blk_queue_discard(q) && \
 -  test_bit(QUEUE_FLAG_SECDISCARD, &(q)->queue_flags))
 +#define blk_queue_secure_erase(q) \
 +  (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))
+ #define blk_queue_dax(q)  test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags)
  
  #define blk_noretry_request(rq) \
((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \


Re: linux-next: manual merge of the device-mapper tree with the block tree

2016-06-10 Thread Mike Snitzer
On Thu, Jun 09 2016 at 12:02am -0400,
Stephen Rothwell  wrote:

> Hi all,
> 
> On Thu, 9 Jun 2016 13:59:32 +1000 Stephen Rothwell  
> wrote:
> >
> >   50d14ab0130a ("dm: move request-based code out to dm-rq.[hc]")
> 
> By the way, resolving these conflicts would have been easier if this
> commit had been split into "move with no changes" followed by "small
> changes" commits.

Yeap, I understand.  I've folded your fix into the appropriate commit
and rebased DM's for-next (and dm-4.8) ontop of block's for-4.8/core.

Thanks,
Mike


Re: linux-next: manual merge of the device-mapper tree with the block tree

2016-06-08 Thread Stephen Rothwell
Hi all,

On Thu, 9 Jun 2016 13:59:32 +1000 Stephen Rothwell  
wrote:
>
>   50d14ab0130a ("dm: move request-based code out to dm-rq.[hc]")

By the way, resolving these conflicts would have been easier if this
commit had been split into "move with no changes" followed by "small
changes" commits.

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the device-mapper tree with the block tree

2016-06-08 Thread Stephen Rothwell
Hi all,

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

  drivers/md/dm.c

between commit:

  528ec5abe680 ("dm: pass dm stats data dir instead of bi_rw")
  c2df40dfb8c0 ("drivers: use req op accessor")
  3a5e02ced11e ("block, drivers: add REQ_OP_FLUSH operation")

from the block tree and commit:

  50d14ab0130a ("dm: move request-based code out to dm-rq.[hc]")

from the device-mapper tree.

I fixed it up (I used the device-mapper tree version of dm.c and then
applied the following patch) 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.

From: Stephen Rothwell 
Date: Thu, 9 Jun 2016 13:47:03 +1000
Subject: [PATCH] dm: fix merge of drivers/dm/dm-rq.c

Signed-off-by: Stephen Rothwell 
---
 drivers/md/dm-rq.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index dfb0721a87fe..266f7b674108 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -189,9 +189,9 @@ static void rq_end_stats(struct mapped_device *md, struct 
request *orig)
if (unlikely(dm_stats_used(&md->stats))) {
struct dm_rq_target_io *tio = tio_from_request(orig);
tio->duration_jiffies = jiffies - tio->duration_jiffies;
-   dm_stats_account_io(&md->stats, orig->cmd_flags, 
blk_rq_pos(orig),
-   tio->n_sectors, true, tio->duration_jiffies,
-   &tio->stats_aux);
+   dm_stats_account_io(&md->stats, rq_data_dir(orig),
+   blk_rq_pos(orig), tio->n_sectors, true,
+   tio->duration_jiffies, &tio->stats_aux);
}
 }
 
@@ -353,7 +353,7 @@ static void dm_done(struct request *clone, int error, bool 
mapped)
r = rq_end_io(tio->ti, clone, error, &tio->info);
}
 
-   if (unlikely(r == -EREMOTEIO && (clone->cmd_flags & REQ_WRITE_SAME) &&
+   if (unlikely(r == -EREMOTEIO && (req_op(clone) == REQ_OP_WRITE_SAME) &&
 !clone->q->limits.max_write_same_sectors))
disable_write_same(tio->md);
 
@@ -681,8 +681,9 @@ static void dm_start_request(struct mapped_device *md, 
struct request *orig)
struct dm_rq_target_io *tio = tio_from_request(orig);
tio->duration_jiffies = jiffies;
tio->n_sectors = blk_rq_sectors(orig);
-   dm_stats_account_io(&md->stats, orig->cmd_flags, 
blk_rq_pos(orig),
-   tio->n_sectors, false, 0, &tio->stats_aux);
+   dm_stats_account_io(&md->stats, rq_data_dir(orig),
+   blk_rq_pos(orig), tio->n_sectors, false, 0,
+   &tio->stats_aux);
}
 
/*
@@ -777,7 +778,7 @@ static void dm_old_request_fn(struct request_queue *q)
 
/* always use block 0 to find the target for flushes for now */
pos = 0;
-   if (!(rq->cmd_flags & REQ_FLUSH))
+   if (req_op(rq) != REQ_OP_FLUSH)
pos = blk_rq_pos(rq);
 
if ((dm_old_request_peeked_before_merge_deadline(md) &&
-- 
2.8.1

-- 
Cheers,
Stephen Rothwell


linux-next: manual merge of the device-mapper tree with the block tree

2015-09-01 Thread Stephen Rothwell
Hi all,

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

  drivers/md/dm-cache-target.c

between commit:

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

from the block tree and commit:

  cc7da0ba9c96 ("dm cache: fix use after freeing migrations")

from the device-mapper tree.

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

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc drivers/md/dm-cache-target.c
index 7245071778db,f9d9cc6a094b..
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@@ -1358,9 -1352,10 +1352,10 @@@ static void issue_discard(struct dm_cac
b = to_dblock(from_dblock(b) + 1);
}
  
 -  bio_endio(bio, 0);
 +  bio_endio(bio);
-   cell_defer(mg->cache, mg->new_ocell, false);
+   cell_defer(cache, mg->new_ocell, false);
free_migration(mg);
+   wake_worker(cache);
  }
  
  static void issue_copy_or_discard(struct dm_cache_migration *mg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the device-mapper tree with the block tree

2013-12-16 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the device-mapper tree got a conflict in
drivers/md/dm-thin.c between commit 4f024f3797c4 ("block: Abstract out
bvec iterator") from the block tree and commit 1d8b40855c42 ("dm thin:
requeue bios to DM core if may_requeue_bios and in read-only mode") from
the device-mapper tree.

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

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc drivers/md/dm-thin.c
index 357eb272dbd9,dde2b1eddbce..
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@@ -1262,8 -1260,8 +1266,8 @@@ static void process_bio_read_only(struc
r = dm_thin_find_block(tc->td, block, 1, &lookup_result);
switch (r) {
case 0:
 -  if (lookup_result.shared && (rw == WRITE) && bio->bi_size)
 +  if (lookup_result.shared && (rw == WRITE) && 
bio->bi_iter.bi_size)
-   bio_io_error(bio);
+   handle_unserviceable_bio(tc->pool, bio);
else {
inc_all_io_entry(tc->pool, bio);
remap_and_issue(tc, bio, lookup_result.block);


pgpK4pXOI9BEW.pgp
Description: PGP signature