Commit 018debea authored by Mike Snitzer's avatar Mike Snitzer Committed by Alasdair G Kergon

dm thin: emit ignore_discard in status when discards 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).
Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent e3cbf945
...@@ -2391,7 +2391,9 @@ static int pool_status(struct dm_target *ti, status_type_t type, ...@@ -2391,7 +2391,9 @@ static int pool_status(struct dm_target *ti, status_type_t type,
else else
DMEMIT("rw "); 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"); DMEMIT("discard_passdown");
else else
DMEMIT("no_discard_passdown"); DMEMIT("no_discard_passdown");
...@@ -2487,7 +2489,7 @@ static struct target_type pool_target = { ...@@ -2487,7 +2489,7 @@ static struct target_type pool_target = {
.name = "thin-pool", .name = "thin-pool",
.features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE | .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE |
DM_TARGET_IMMUTABLE, DM_TARGET_IMMUTABLE,
.version = {1, 5, 0}, .version = {1, 6, 0},
.module = THIS_MODULE, .module = THIS_MODULE,
.ctr = pool_ctr, .ctr = pool_ctr,
.dtr = pool_dtr, .dtr = pool_dtr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment