Re: [RFC] block: Make MMC respect REQ_NOUNMAP?
From: Christoph Hellwig
Date: Thu May 08 2025 - 02:00:06 EST
On Wed, May 07, 2025 at 06:24:34PM +0200, Ahmad Fatoum wrote:
> blk_ioctl_zeroout
> blkdev_issue_zeroout(..., BLKDEV_ZERO_NOUNMAP)
> __blkdev_issue_write_zeroes(..., BLKDEV_ZERO_NOUNMAP)
> submit_bio_wait(bio->bi_opf = REQ_NOUNMAP)
>
> __REQ_NOUNMAP has comment saying 'do not free blocks when zeroing',
> but as shown above, TRIM allows the card to unmap the indicated region.
__REQ_NOUNMAP is a hint. All the storage specs are a mess in this
area as they usually get the polarity wrong and/or just have very
vague semantics. Also actually writing zeroes and not unmapping is
totally pointless on flash storage as it just increases PE cycles
for no good reason.