APPLIED: [B/D/E] Prevent fstrim failure so unused blocks can be discarded

Khaled Elmously khalid.elmously at canonical.com
Wed Jan 29 04:21:36 UTC 2020


On 2020-01-14 11:04:44 , Connor Kuehl wrote:
> BugLink: https://bugs.launchpad.net/1856603
> 
> [Impact]
> 
> Discard requests can fail on a non-compliant nvme device meaning that
> prescribed maintenance use of fstrim will be unsuccessful and unused blocks are
> no longer properly disposed of.
> 
> [Test case]
> 
> Run fstrim (from bug report, ran as root: fstrim -v /)
> 
> Expected result: "/: 758.3 GiB (814159003648 bytes) trimmed" -- will vary
> depending on the blocks that are unused for your system
> 
> Unpatched actual result: "fstrim: /: FITRIM ioctl failed: Input/output error"
> 
> [Regression Potential]
> 
> This patch only increases the size of a memory allocation and does not add any
> changes in logic for error handling or normal flow of control. Furthermore, this
> allocation size is what was used for discard until this commit reduced the size of
> the allocation: 03b5929ebb20 ("nvme: rewrite discard support"). This routine
> already handles the case where the memory allocation fails. Because of this, it
> is a low risk change.
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



More information about the kernel-team mailing list