Skip to contentSkip to conversation

dm thin: emit "ignore_discard" in status if discards are disabled

PATCH New Mike Snitzer 1 participant 1 message Dec 10, 2012 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm thin: emit "ignore_discard" in status if discards are disabled

If "ignore_discard" is specified when creating the thin pool device then discard support is disabled for that device. The pool device's status should reflect this fact rather than stating "no_discard_passdown" (which implies discards are enabled but passdown is disabled).

---
 drivers/md/dm-thin.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/md/dm-thin.c +3 -1
index 4644f5e..f1d2f5e 100644
@@ -2370,7 +2370,9 @@ static int pool_status(struct dm_target *ti, status_type_t type,
 		else
 			DMEMIT("rw ");
 
-		if (pool->pf.discard_enabled && pool->pf.discard_passdown)
+		if (!pool->pf.discard_enabled)
+			DMEMIT("ignore_discard");
+		else if (pool->pf.discard_passdown)
 			DMEMIT("discard_passdown");
 		else
 			DMEMIT("no_discard_passdown");
Signature · 1 line
1.7.1