]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
update 4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 07:29:56 +0000 (09:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 07:29:56 +0000 (09:29 +0200)
queue-4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch

index 520ab47ab4afd77bc7bcd06f5c3ceb8343832eb1..277e7a64030d282a500a024fc408cca0cdcbe65e 100644 (file)
@@ -26,12 +26,15 @@ Signed-off-by: Jens Axboe <axboe@fb.com>
 [jwang: backport to 4.4]
 Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+[bwh: Restore changes in device-mapper from upstream version]
+Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
 ---
  block/bio.c         |   12 +++++++++---
  block/blk-core.c    |   31 +++++++++++++++++++------------
+ drivers/md/dm.c     |   29 ++++++++++++++++-------------
  drivers/md/raid1.c  |    3 ++-
  drivers/md/raid10.c |    3 ++-
4 files changed, 32 insertions(+), 17 deletions(-)
5 files changed, 48 insertions(+), 30 deletions(-)
 
 --- a/block/bio.c
 +++ b/block/bio.c
@@ -138,6 +141,51 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        } while (bio);
        current->bio_list = NULL; /* deactivate */
  
+--- a/drivers/md/dm.c
++++ b/drivers/md/dm.c
+@@ -1481,26 +1481,29 @@ static void flush_current_bio_list(struc
+       struct dm_offload *o = container_of(cb, struct dm_offload, cb);
+       struct bio_list list;
+       struct bio *bio;
++      int i;
+       INIT_LIST_HEAD(&o->cb.list);
+       if (unlikely(!current->bio_list))
+               return;
+-      list = *current->bio_list;
+-      bio_list_init(current->bio_list);
+-
+-      while ((bio = bio_list_pop(&list))) {
+-              struct bio_set *bs = bio->bi_pool;
+-              if (unlikely(!bs) || bs == fs_bio_set) {
+-                      bio_list_add(current->bio_list, bio);
+-                      continue;
++      for (i = 0; i < 2; i++) {
++              list = current->bio_list[i];
++              bio_list_init(&current->bio_list[i]);
++
++              while ((bio = bio_list_pop(&list))) {
++                      struct bio_set *bs = bio->bi_pool;
++                      if (unlikely(!bs) || bs == fs_bio_set) {
++                              bio_list_add(&current->bio_list[i], bio);
++                              continue;
++                      }
++
++                      spin_lock(&bs->rescue_lock);
++                      bio_list_add(&bs->rescue_list, bio);
++                      queue_work(bs->rescue_workqueue, &bs->rescue_work);
++                      spin_unlock(&bs->rescue_lock);
+               }
+-
+-              spin_lock(&bs->rescue_lock);
+-              bio_list_add(&bs->rescue_list, bio);
+-              queue_work(bs->rescue_workqueue, &bs->rescue_work);
+-              spin_unlock(&bs->rescue_lock);
+       }
+ }
 --- a/drivers/md/raid1.c
 +++ b/drivers/md/raid1.c
 @@ -877,7 +877,8 @@ static sector_t wait_barrier(struct r1co