From: Mike Snitzer Date: Fri, 6 Nov 2015 15:53:01 +0000 (-0500) Subject: dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition X-Git-Tag: v3.14.63~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=613c515dc0462beba95912ac8a077c9878dcf768;p=thirdparty%2Fkernel%2Fstable.git dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition commit 172c238612ebf81cabccc86b788c9209af591f61 upstream. A thin-pool that is in out-of-data-space (OODS) mode may transition back to write mode -- without the admin adding more space to the thin-pool -- if/when blocks are released (either by deleting thin devices or discarding provisioned blocks). But as part of the thin-pool's earlier transition to out-of-data-space mode the thin-pool may have set the 'error_if_no_space' flag to true if the no_space_timeout expires without more space having been made available. That implementation detail, of changing the pool's error_if_no_space setting, needs to be reset back to the default that the user specified when the thin-pool's table was loaded. Otherwise we'll drop the user requested behaviour on the floor when this out-of-data-space to write mode transition occurs. Reported-by: Vivek Goyal Signed-off-by: Mike Snitzer Acked-by: Joe Thornber Fixes: 2c43fd26e4 ("dm thin: fix missing out-of-data-space to write mode transition if blocks are released") Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index b94e4648c199b..7cafbd4432df2 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1619,6 +1619,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) case PM_WRITE: if (old_mode != new_mode) notify_of_pool_mode_change(pool, "write"); + pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space; dm_pool_metadata_read_write(pool->pmd); pool->process_bio = process_bio; pool->process_discard = process_discard;