Am 11.04.2025 um 13:30 hat Alberto Faria geschrieben:
> Simply propagate the FUA flag on write requests to the driver. The block
> layer will emulate it if necessary.
>
> Signed-off-by: Alberto Faria <[email protected]>
> ---
> hw/scsi/scsi-disk.c | 43 ++++++++++---------------------------------
> 1 file changed, 10 insertions(+), 33 deletions(-)
> @@ -416,12 +398,7 @@ static void scsi_dma_complete_noio(SCSIDiskReq *r, int
> ret)
>
> r->sector += r->sector_count;
> r->sector_count = 0;
> - if (r->req.cmd.mode == SCSI_XFER_TO_DEV) {
> - scsi_write_do_fua(r);
> - return;
> - } else {
> - scsi_req_complete(&r->req, GOOD);
> - }
> + scsi_req_complete(&r->req, GOOD);
>
> done:
> scsi_req_unref(&r->req);
This (and the same change in scsi_write_complete_noio()) breaks the
handling of VERIFY in scsi_write_data().
I think what VERIFY needs to do after this change is calling
blk_aio_flush() directly, similar to what scsi_read_data() does in the
first && r->needs_fua case.
The READ and WRITE commands look good to me with this change.
Kevin