linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-block@vger.kernel.org, jasowang@redhat.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Xie Yongji <xieyongji@bytedance.com>
Subject: Re: [PATCH] virtio-blk: limit seg_max to a safe value
Date: Wed, 19 May 2021 09:40:21 +0100	[thread overview]
Message-ID: <YKTO9QKwoyu/F3x9@stefanha-x1.localdomain> (raw)
In-Reply-To: <20210519075702.GA4225@lst.de>

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

On Wed, May 19, 2021 at 09:57:02AM +0200, Christoph Hellwig wrote:
> On Tue, May 18, 2021 at 04:04:15PM +0100, Stefan Hajnoczi wrote:
> > +	/* Prevent integer overflows and excessive blk-mq req cmd_size */
> > +	sg_elems = min_t(u32, sg_elems, SG_MAX_SEGMENTS);
> 
> Please pick your own constant here instead of abusing some kernel
> implementation detail (that is fairly SCSI specific to start with).
> 
> It might be useful to also document such limits, even if just advisory,
> in the virtio spec.

Thanks, will fix in v2.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2021-05-19  8:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 15:04 [PATCH] virtio-blk: limit seg_max to a safe value Stefan Hajnoczi
2021-05-19  7:57 ` Christoph Hellwig
2021-05-19  8:40   ` Stefan Hajnoczi [this message]

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=YKTO9QKwoyu/F3x9@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=xieyongji@bytedance.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).