public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: ceph-devel@vger.kernel.org, linux-cachefs@redhat.com,
	pfmeec@rit.edu, dhowells@redhat.com, idryomov@gmail.com,
	stable@vger.kernel.org, Andrew W Elble <aweits@rit.edu>
Subject: Re: [PATCH v2] ceph: fix write_begin optimization when write is beyond EOF
Date: Sat, 12 Jun 2021 14:36:12 +0100	[thread overview]
Message-ID: <YMS4TOw8txQQ7VGr@casper.infradead.org> (raw)
In-Reply-To: <20210612001141.167797-1-jlayton@kernel.org>

On Fri, Jun 11, 2021 at 08:11:41PM -0400, Jeff Layton wrote:
>  		if ((pos_in_page == 0 && len == PAGE_SIZE) ||
> -		    (pos >= i_size_read(inode)) ||
> +		    (index > (i_size_read(inode) - 1) / PAGE_SIZE) ||
>  		    (pos_in_page == 0 && (pos + len) >= i_size_read(inode))) {

You missed the (i_size == 0) case.  And I really would factor out
reading i_size into a local variable.

>  			zero_user_segments(page, 0, pos_in_page,
>  					   pos_in_page + len, PAGE_SIZE);
> -- 
> 2.31.1
> 

  reply	other threads:[~2021-06-12 13:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 19:59 [PATCH] ceph: fix write_begin optimization when write is beyond EOF Jeff Layton
2021-06-11 20:48 ` Matthew Wilcox
2021-06-11 22:20   ` Jeff Layton
2021-06-12  0:11 ` [PATCH v2] " Jeff Layton
2021-06-12 13:36   ` Matthew Wilcox [this message]
2021-06-12 18:35     ` [PATCH v3] " Jeff Layton
2021-06-13 11:04       ` Matthew Wilcox
2021-06-13 11:36         ` [PATCH v4] " Jeff Layton
2021-06-13 12:02           ` Jeff Layton
2021-06-13 15:15             ` Matthew Wilcox
2021-06-13 15:25               ` Jeff Layton

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=YMS4TOw8txQQ7VGr@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=aweits@rit.edu \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cachefs@redhat.com \
    --cc=pfmeec@rit.edu \
    --cc=stable@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