linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Cc: guaneryu@gmail.com, linux-fsdevel@vger.kernel.org,
	Felix.Kuehling@amd.com
Subject: Re: [PATCH v3] direct-io: Fix unsigned comparison overflow
Date: Wed, 6 Dec 2017 10:23:04 -0800	[thread overview]
Message-ID: <20171206182304.GA7829@bombadil.infradead.org> (raw)
In-Reply-To: <1512579438-4854-1-git-send-email-Harish.Kasiviswanathan@amd.com>

On Wed, Dec 06, 2017 at 11:57:18AM -0500, Harish Kasiviswanathan wrote:
> The first write after file create fails to take the direct IO
> (Peer-to-Peer) path and falls back to slower software copy. The function
> get_more_block() sets 'create' to 0 after comparing 'unsigned long
> fs_startblk = 0' with 'long long (i_size_read(dio->inode) - 1) >>
> i_blkbits = 0xfffffffffffff'.
> 
> v2: Instead of casting to loff_t check explicitly if i_size > 0
> v3: Use cached dio->i_size instead of i_size_read() which isn't cheap on
>     32-bit SMP
> 
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>

Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>

      reply	other threads:[~2017-12-06 18:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 16:57 [PATCH v3] direct-io: Fix unsigned comparison overflow Harish Kasiviswanathan
2017-12-06 18:23 ` Matthew Wilcox [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=20171206182304.GA7829@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=Felix.Kuehling@amd.com \
    --cc=Harish.Kasiviswanathan@amd.com \
    --cc=guaneryu@gmail.com \
    --cc=linux-fsdevel@vger.kernel.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).