]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: mark group as trimmed only if it was fully scanned
authorDmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Sun, 17 Apr 2022 17:03:15 +0000 (20:03 +0300)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 17 May 2022 18:17:21 +0000 (14:17 -0400)
commita979b726c3ed50f538ae6b7560de9b0d8dd87bf5
tree68e82e9ce0c7674d0ccd21b5dbb5e5c000579d0c
parent74935ab1384170a18f0733f7a352dbc2b2e0da55
ext4: mark group as trimmed only if it was fully scanned

Otherwise nonaligned fstrim calls will works inconveniently for iterative
scanners, for example:

// trim [0,16MB] for group-1, but mark full group as trimmed
fstrim  -o $((1024*1024*128)) -l $((1024*1024*16)) ./m
// handle [16MB,16MB] for group-1, do nothing because group already has the flag.
fstrim  -o $((1024*1024*144)) -l $((1024*1024*16)) ./m

[ Update function documentation for ext4_trim_all_free -- TYT ]

Signed-off-by: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Link: https://lore.kernel.org/r/1650214995-860245-1-git-send-email-dmtrmonakhov@yandex-team.ru
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/mballoc.c