From: Joe Thornber Date: Wed, 10 Dec 2014 17:06:57 +0000 (+0000) Subject: dm thin: fix inability to discard blocks when in out-of-data-space mode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=45ec9bd0fd7abf8705e7cf12205ff69fe9d51181;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dm thin: fix inability to discard blocks when in out-of-data-space mode When the pool was in PM_OUT_OF_SPACE mode its process_prepared_discard function pointer was incorrectly being set to process_prepared_discard_passdown rather than process_prepared_discard. This incorrect function pointer meant the discard was being passed down, but not effecting the mapping. As such any discard that was issued, in an attempt to reclaim blocks, would not successfully free data space. Reported-by: Eric Sandeen Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer Cc: stable@vger.kernel.org --- diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 8735543eacdb..14b51a4fdf6b 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -2155,7 +2155,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) pool->process_cell = process_cell_read_only; pool->process_discard_cell = process_discard_cell; pool->process_prepared_mapping = process_prepared_mapping; - pool->process_prepared_discard = process_prepared_discard_passdown; + pool->process_prepared_discard = process_prepared_discard; if (!pool->pf.error_if_no_space && no_space_timeout) queue_delayed_work(pool->wq, &pool->no_space_timeout, no_space_timeout);