linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2] block: fix get_max_segment_size() overflow on 32bit arch
Date: Sat, 11 Jan 2020 08:51:31 -0700	[thread overview]
Message-ID: <62d41f31-a50b-8416-fcf5-abcbb675176f@kernel.dk> (raw)
In-Reply-To: <20200111125743.4222-1-ming.lei@redhat.com>

On 1/11/20 5:57 AM, Ming Lei wrote:
> Commit 429120f3df2d starts to take account of segment's start dma address
> when computing max segment size, and data type of 'unsigned long'
> is used to do that. However, the segment mask may be 0xffffffff, so
> the figured out segment size may be overflowed in case of zero physical
> address on 32bit arch.
> 
> Fix the issue by returning queue_max_segment_size() directly when that
> happens.

I still think this should use phys_addr_t, just in case the mask is
ever not 32-bit. The current types are a bit weird, tbh.

-- 
Jens Axboe


  reply	other threads:[~2020-01-11 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 12:57 [PATCH V2] block: fix get_max_segment_size() overflow on 32bit arch Ming Lei
2020-01-11 15:51 ` Jens Axboe [this message]
2020-01-12  6:58   ` Ming Lei

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=62d41f31-a50b-8416-fcf5-abcbb675176f@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ming.lei@redhat.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).