qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Faria <afaria@redhat.com>
Cc: qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	qemu-block@nongnu.org, "Fam Zheng" <fam@euphon.net>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Zhao Liu" <zhao1.liu@intel.com>
Subject: Re: [PATCH v2 1/2] scsi-disk: Add native FUA write support
Date: Fri, 25 Apr 2025 17:02:04 +0200	[thread overview]
Message-ID: <aAuj7M4pTO0B_WA3@redhat.com> (raw)
In-Reply-To: <20250411113036.786841-2-afaria@redhat.com>

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 <afaria@redhat.com>
> ---
>  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



  reply	other threads:[~2025-04-25 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 11:30 [PATCH v2 0/2] scsi-disk: Add FUA write support Alberto Faria
2025-04-11 11:30 ` [PATCH v2 1/2] scsi-disk: Add native " Alberto Faria
2025-04-25 15:02   ` Kevin Wolf [this message]
2025-04-11 11:30 ` [PATCH v2 2/2] scsi-disk: Advertise FUA support by default Alberto Faria
2025-04-25 15:05   ` Kevin Wolf
2025-05-02 12:12     ` Alberto Faria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aAuj7M4pTO0B_WA3@redhat.com \
    --to=kwolf@redhat.com \
    --cc=afaria@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=fam@euphon.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).