qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Max Reitz" <mreitz@redhat.com>,
	"Dmitry Fomichev" <dmitry.fomichev@wdc.com>,
	"Kevin Wolf" <kwolf@redhat.com>, "Fam Zheng" <fam@euphon.net>,
	"Maxim Levitsky" <mlevitsk@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 1/2] file-posix: Correctly read max_segments of SG nodes
Date: Sat, 19 Sep 2020 17:15:49 +0200	[thread overview]
Message-ID: <2998e3eb-306f-62d4-0588-dae0a097d0ba@redhat.com> (raw)
In-Reply-To: <808e395e-6f99-acdb-03dc-400f6bd32311@redhat.com>

On 17/09/20 15:16, Max Reitz wrote:
> So is this path ever taken, or can we just replace it all with the ioctl?
> 
> (Before 867eccfed84, this function was used for all host devices, which
> might explain why the code even exists.)

Because 867eccfed84 is wrong.  If you use /dev/sda* with SG_IO you do
need to take into account the hardware max segment size/max segment count.

Probably ->sg needs to be set by the front-end, not by the back-end.  An
even better way (but for which I'd leave the task to you and Kevin)
could be to have a new permission BLK_PERM_WRITE_BYPASS and to reduce
the limits to the hardware limits if anybody has requested that
permission.  I tried to implement that a couple years ago but I just
couldn't wrap my mind around the permission code.

Paolo



  parent reply	other threads:[~2020-09-19 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 22:51 [PATCH 0/2] block;scsi-generic: Fix max transfer size calculation Dmitry Fomichev
2020-08-11 22:51 ` [PATCH 1/2] file-posix: Correctly read max_segments of SG nodes Dmitry Fomichev
2020-09-17 13:16   ` Max Reitz
2020-09-17 13:22     ` Maxim Levitsky
2020-09-17 13:24       ` Maxim Levitsky
2020-09-17 16:44         ` Dmitry Fomichev
2020-09-19 15:18           ` Paolo Bonzini
2020-09-19 15:15     ` Paolo Bonzini [this message]
2020-08-11 22:51 ` [PATCH 2/2] scsi-generic: Fix HM-zoned device scan Dmitry Fomichev
2020-08-17 15:58   ` Alistair Francis
2020-08-17 16:38 ` [PATCH 0/2] block; scsi-generic: Fix max transfer size calculation Paolo Bonzini

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=2998e3eb-306f-62d4-0588-dae0a097d0ba@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dmitry.fomichev@wdc.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).