#10336: TRIM / fstrim can destroy data on SSD's when executed
----------------------------+----------------------------
Reporter: kallisti5 | Owner: axeld
Type: bug | Status: in-progress
Priority: blocker | Milestone: R1/beta1
Component: Drivers/Disk | Version: R1/Development
Resolution: | Keywords: TRIM fstrim
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------+----------------------------
Comment (by pulkomandy):
I have set up a machine for testing purposes. Thinkpad X200 with Kingston
60GB SSD, SV300S37A60G. I'm using a 3GB partition near the start of the
disk, on which I installed Haiku. I am trimming the boot volume, without
other activity happening.
So far I have not managed to corrupt the drive this way. However, the trim
command will time out. The HDD led stays on for some time, but then the
command is aborted.
{{{
port reset: port 0 undergoing COMRESET
ExecuteAtaRequest port 0: device timeout
sata_request::abort called for command 0x06
trim failed (64 ranges)!
}}}
It seems the command is simply taking too long to execute, and eventually
the port is reset to "unlock" the situation. On this SSD, it seems to not
have any effect (trimming a partition that was cleaned with dd
if=/dev/zero first does not change its data). But, it could be that other
drives/firmwares are much less happy about being reset while they are
TRIMing stuff, and it could lead to loss of data if they don't handle
their transactions properly?
I'm going to reduce the number of blocks to trim per command, so that it
executes faster and does not time out.
--
Ticket URL: <https://dev.haiku-os.org/ticket/10336#comment:24>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.