Skip to content

Commit 172c238

Browse files
committed
dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Acked-by: Joe Thornber <[email protected]> Fixes: 2c43fd2 ("dm thin: fix missing out-of-data-space to write mode transition if blocks are released") Cc: [email protected]
1 parent 8005c49 commit 172c238

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/dm-thin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
24322432
case PM_WRITE:
24332433
if (old_mode != new_mode)
24342434
notify_of_pool_mode_change(pool, "write");
2435+
pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space;
24352436
dm_pool_metadata_read_write(pool->pmd);
24362437
pool->process_bio = process_bio;
24372438
pool->process_discard = process_discard_bio;

0 commit comments

Comments
 (0)