Skip to contentSkip to conversation

dm thin: allow metadata commit if pool is in PM_OUT_OF_DATA_SPACE mode

PATCH New Mike Snitzer 1 participant 1 message May 7, 2014 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm thin: allow metadata commit if pool is in PM_OUT_OF_DATA_SPACE mode

From: Joe Thornber <[email protected]>

Commit 3e1a0699 ("dm thin: fix out of data space handling") introduced a regression in the metadata commit() method by returning an error if the pool is in PM_OUT_OF_DATA_SPACE mode. This oversight caused a thin device to return errors even if the default queue_if_no_space ENOSPC handling mode is used.

Fix commit() to only fail if pool is in PM_READ_ONLY or PM_FAIL mode.

---
 drivers/md/dm-thin.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/md/dm-thin.c +1 -1
index 13abade..15f748b 100644
@@ -935,7 +935,7 @@ static int commit(struct pool *pool)
 {
 	int r;
 
-	if (get_pool_mode(pool) != PM_WRITE)
+	if (get_pool_mode(pool) >= PM_READ_ONLY)
 		return -EINVAL;
 
 	r = dm_pool_commit_metadata(pool->pmd);
Signature · 1 line
1.7.1