ACK: [B/D/E] Prevent fstrim failure so unused blocks can be discarded
Colin Ian King
colin.king at canonical.com
Tue Jan 14 19:09:46 UTC 2020
On 14/01/2020 19:04, 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.
>
Having a little extra slack waste is definitely a minor impact compared
to the issue this fixes. Also has positive test results, so, looks OK to
me. Thanks Conner.
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the kernel-team
mailing list