diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2024-05-06 23:55:44 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2024-05-09 15:10:58 +0200 |
commit | 64eb88d6caee2c8eb806a68dab3f184f14f818a4 (patch) | |
tree | bd35659a6e07ccc880e2d3bc903e090fdcdbed19 | |
parent | dm-delay: fix hung task introduced by kthread mode (diff) | |
download | linux-64eb88d6caee2c8eb806a68dab3f184f14f818a4.tar.xz linux-64eb88d6caee2c8eb806a68dab3f184f14f818a4.zip |
dm-delay: fix max_delay calculations
delay_ctr() pointlessly compared max_delay in cases where multiple delay
classes were initialized identically. Also, when write delays were
configured different than read delays, delay_ctr() never compared their
value against max_delay. Fix these issues.
Fixes: 70bbeb29fab0 ("dm delay: for short delays, use kthread instead of timers and wq")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
-rw-r--r-- | drivers/md/dm-delay.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index 4ba12d536994..2ac43d1f1b92 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -242,19 +242,18 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) ret = delay_class_ctr(ti, &dc->flush, argv); if (ret) goto bad; - max_delay = max(max_delay, dc->write.delay); - max_delay = max(max_delay, dc->flush.delay); goto out; } ret = delay_class_ctr(ti, &dc->write, argv + 3); if (ret) goto bad; + max_delay = max(max_delay, dc->write.delay); + if (argc == 6) { ret = delay_class_ctr(ti, &dc->flush, argv + 3); if (ret) goto bad; - max_delay = max(max_delay, dc->flush.delay); goto out; } |