mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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: 70bbeb29fa
("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>
This commit is contained in:
parent
d14646f233
commit
64eb88d6ca
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user