[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#909473: fstrim shows incorrect trimmed size after reboot



Le 8/06/21 à 21:24, Bastian Blank a écrit :
Hi
Hello,
On Tue, Jun 08, 2021 at 03:48:11PM +0200, Laurent Bigonville wrote:
There is definitely something boggus here
Yes, just tested it now and  it's still happening with the kernel currently
in unstable (5.10.40-1)
Why do you think this numbers are wrong?  "fstrim" initially requests
discard of all unused blocks, so a large number.  But why should it do
the same on subsequent calls while it still knows what it did the last
time?

ext4 caches the information if a particular block group was trimmed, but
this information is not persistent.  (Using bit
EXT4_GROUP_INFO_WAS_TRIMMED_BIT in ext4_group_info.bb_state.)

Well I would expect that if I'm running fstrim, the same blocks would not be trimmed again (even after reboot) if I'm running the command again

Here it seems that it's the case, the number of blocks that are being trimmed are the same after reboot.

Are the discard commands delayed and actually not executed when the command is run, or am I overlooking something?


Reply to: