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

Stefan Bader stefan.bader at canonical.com
Thu Jan 16 14:36:42 UTC 2020


On 14.01.20 20: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.
> 
For Disco I am not sure this would only be needed in the oem-osp1 derivative.
For that reason I think better safe than sorry.

Acked-by: Stefan Bader <stefan.bader at canonical.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200116/64bb4d6b/attachment.sig>


More information about the kernel-team mailing list