On Wed, 13 Dec 2023 16:16:35 +1100, Suraj Jitindar Singh wrote: > The ext4 filesystem tracks the trim status of blocks at the group level. > When an entire group has been trimmed then it is marked as such and subsequent > trim invocations with the same minimum trim size will not be attempted on that > group unless it is marked as able to be trimmed again such as when a block is > freed. > > Currently the last group can't be marked as trimmed due to incorrect logic > in ext4_last_grp_cluster(). ext4_last_grp_cluster() is supposed to return the > zero based index of the last cluster in a group. This is then used by > ext4_try_to_trim_range() to determine if the trim operation spans the entire > group and as such if the trim status of the group should be recorded. > > [...] Applied, thanks! [1/1] fs/ext4: Allow for the last group to be marked as trimmed commit: ddf2aa1bac7d9be3b8ba374c5bdb88da06e3e10f Best regards, -- Theodore Ts'o <tytso@xxxxxxx>