From: Greg Kroah-Hartman Date: Sat, 8 Apr 2017 07:29:56 +0000 (+0200) Subject: update 4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch X-Git-Tag: v4.9.21~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d43d5d41a5d846626ff1a6da360e6b695b85519;p=thirdparty%2Fkernel%2Fstable-queue.git update 4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch --- diff --git a/queue-4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch b/queue-4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch index 520ab47ab4a..277e7a64030 100644 --- a/queue-4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch +++ b/queue-4.4/blk-ensure-users-for-current-bio_list-can-see-the-full-list.patch @@ -26,12 +26,15 @@ Signed-off-by: Jens Axboe [jwang: backport to 4.4] Signed-off-by: Jack Wang Signed-off-by: Greg Kroah-Hartman +[bwh: Restore changes in device-mapper from upstream version] +Signed-off-by: Ben Hutchings --- 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 } 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(¤t->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(¤t->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