Skip to content

Commit f8facb6

Browse files
snitmkergon
authored andcommitted
dm: zero silently drop discards
Have the zero target silently drop a discard rather than fail the request with -EOPNOTSUPP. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent b441a26 commit f8facb6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/md/dm-zero.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
2222
return -EINVAL;
2323
}
2424

25+
/*
26+
* Silently drop discards, avoiding -EOPNOTSUPP.
27+
*/
28+
ti->num_discard_requests = 1;
29+
2530
return 0;
2631
}
2732

0 commit comments

Comments
 (0)