]> git.itanic.dy.fi Git - linux-stable/commit
ext4: do not let fstrim block system suspend
authorJan Kara <jack@suse.cz>
Wed, 13 Sep 2023 15:04:55 +0000 (17:04 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 14 Sep 2023 16:06:59 +0000 (12:06 -0400)
commit5229a658f6453362fbb9da6bf96872ef25a7097e
treec8fc8b4054e34de2aa95d42d44cd0c5d8cd94658
parent45e4ab320c9b5fa67b1fc3b6a9b381cfcc0c8488
ext4: do not let fstrim block system suspend

Len Brown has reported that system suspend sometimes fail due to
inability to freeze a task working in ext4_trim_fs() for one minute.
Trimming a large filesystem on a disk that slowly processes discard
requests can indeed take a long time. Since discard is just an advisory
call, it is perfectly fine to interrupt it at any time and the return
number of discarded blocks until that moment. Do that when we detect the
task is being frozen.

Cc: stable@kernel.org
Reported-by: Len Brown <lenb@kernel.org>
Suggested-by: Dave Chinner <david@fromorbit.com>
References: https://bugzilla.kernel.org/show_bug.cgi?id=216322
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230913150504.9054-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c