]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/ctree.h
btrfs: don't miss async discards after scheduled work override
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 4 Nov 2020 09:45:53 +0000 (09:45 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:54:05 +0000 (15:54 +0100)
commitdf903e5d294f62e07280566e0afe9403a92879f0
tree83f7e6680135e2de402852ee7a48d260726bc7ad
parent6e88f116bd4cf34406fc70a6d6bf5b4d49e1ab2d
btrfs: don't miss async discards after scheduled work override

If btrfs_discard_schedule_work() is called with override=true, it sets
delay anew regardless how much time is left until the timer should have
fired. If delays are long (that can happen, for example, with low
kbps_limit), they might get constantly overridden without having a
chance to run the discard work.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/discard.c