فهرست منبع

dm thin: synchronize the pool mode during suspend

Commit b5330655 ("dm thin: handle metadata failures more consistently")
increased potential for the pool's mode to be changed in response to
metadata operation failures.

When the pool mode is changed it isn't synchronized with the mode in
pool_features stored in the target's context (ti->private) that is used
as the basis for (re)establishing the pool mode during resume via
bind_control_target.

It is important that we synchronize the pool mode when it is changed
otherwise the pool may experience and unexpected mode transition on the
next resume (especially if there was no new table load).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Mike Snitzer 11 سال پیش
والد
کامیت
cdc2b41584
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      drivers/md/dm-thin.c

+ 6 - 0
drivers/md/dm-thin.c

@@ -1402,6 +1402,7 @@ static enum pool_mode get_pool_mode(struct pool *pool)
 static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
 static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
 {
 {
 	int r;
 	int r;
+	struct pool_c *pt = pool->ti->private;
 	enum pool_mode old_mode = pool->pf.mode;
 	enum pool_mode old_mode = pool->pf.mode;
 
 
 	switch (new_mode) {
 	switch (new_mode) {
@@ -1448,6 +1449,11 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
 	}
 	}
 
 
 	pool->pf.mode = new_mode;
 	pool->pf.mode = new_mode;
+	/*
+	 * The pool mode may have changed, sync it so bind_control_target()
+	 * doesn't cause an unexpected mode transition on resume.
+	 */
+	pt->adjusted_pf.mode = new_mode;
 }
 }
 
 
 /*
 /*