On Tue, Sep 20, 2022 at 01:59:46PM -0400, Mikulas Patocka wrote:
This patch implements REQ_OP_SECURE_ERASE and REQ_OP_WRITE_ZEROES on brd.
Write zeroes will free the pages just like discard, but the difference is
that it writes zeroes to the preceding and following page if the range is
not aligned on page boundary. Secure erase is just like write zeroes,
except that it clears the page content before freeing the page.
So while I can see the use case for the simple discard you mentioned,
and maybe even the WRITE_ZEROES, I'd rather have a really good
justification for REQ_OP_SECURE_ERASE. It is a bad interface,
and there are alsmost no good reasons for ever using it. So sprinkling
it in random drivers just we can is not helpful.