This is a note to let you know that I've just added the patch titled dm thin: initialize dm_thin_new_mapping returned by get_next_mapping to the 3.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-thin-initialize-dm_thin_new_mapping-returned-by-get_next_mapping.patch and it can be found in the queue-3.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 16961b042db8cc5cf75d782b4255193ad56e1d4f Mon Sep 17 00:00:00 2001 From: Mike Snitzer <snitzer@xxxxxxxxxx> Date: Tue, 17 Dec 2013 13:19:11 -0500 Subject: dm thin: initialize dm_thin_new_mapping returned by get_next_mapping From: Mike Snitzer <snitzer@xxxxxxxxxx> commit 16961b042db8cc5cf75d782b4255193ad56e1d4f upstream. As additional members are added to the dm_thin_new_mapping structure care should be taken to make sure they get initialized before use. Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Acked-by: Joe Thornber <ejt@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm-thin.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -760,13 +760,17 @@ static int ensure_next_mapping(struct po static struct dm_thin_new_mapping *get_next_mapping(struct pool *pool) { - struct dm_thin_new_mapping *r = pool->next_mapping; + struct dm_thin_new_mapping *m = pool->next_mapping; BUG_ON(!pool->next_mapping); + memset(m, 0, sizeof(struct dm_thin_new_mapping)); + INIT_LIST_HEAD(&m->list); + m->bio = NULL; + pool->next_mapping = NULL; - return r; + return m; } static void schedule_copy(struct thin_c *tc, dm_block_t virt_block, @@ -778,15 +782,10 @@ static void schedule_copy(struct thin_c struct pool *pool = tc->pool; struct dm_thin_new_mapping *m = get_next_mapping(pool); - INIT_LIST_HEAD(&m->list); - m->quiesced = 0; - m->prepared = 0; m->tc = tc; m->virt_block = virt_block; m->data_block = data_dest; m->cell = cell; - m->err = 0; - m->bio = NULL; if (!dm_deferred_set_add_work(pool->shared_read_ds, &m->list)) m->quiesced = 1; @@ -849,15 +848,12 @@ static void schedule_zero(struct thin_c struct pool *pool = tc->pool; struct dm_thin_new_mapping *m = get_next_mapping(pool); - INIT_LIST_HEAD(&m->list); m->quiesced = 1; m->prepared = 0; m->tc = tc; m->virt_block = virt_block; m->data_block = data_block; m->cell = cell; - m->err = 0; - m->bio = NULL; /* * If the whole block of data is being overwritten or we are not @@ -1055,7 +1051,6 @@ static void process_discard(struct thin_ m->data_block = lookup_result.block; m->cell = cell; m->cell2 = cell2; - m->err = 0; m->bio = bio; if (!dm_deferred_set_add_work(pool->all_io_ds, &m->list)) { Patches currently in stable-queue which might be from snitzer@xxxxxxxxxx are queue-3.13/dm-thin-fix-discard-support-to-a-previously-shared-block.patch queue-3.13/dm-thin-fix-set_pool_mode-exposed-pool-operation-races.patch queue-3.13/dm-space-map-metadata-fix-extending-the-space-map.patch queue-3.13/dm-space-map-common-make-sure-new-space-is-used-during-extend.patch queue-3.13/dm-wait-until-embedded-kobject-is-released-before-destroying-a-device.patch queue-3.13/dm-thin-initialize-dm_thin_new_mapping-returned-by-get_next_mapping.patch queue-3.13/dm-space-map-metadata-fix-bug-in-resizing-of-thin-metadata.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html