From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
hch@infradead.org
Subject: Re: [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin
Date: Thu, 10 Sep 2020 08:37:01 -0700 [thread overview]
Message-ID: <20200910153701.GC7964@magnolia> (raw)
In-Reply-To: <20200910124743.27603-1-nborisov@suse.com>
On Thu, Sep 10, 2020 at 03:47:43PM +0300, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/iomap/buffered-io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index bcfc288dba3f..31eb680d8c64 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -571,8 +571,8 @@ __iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, int flags,
> {
> struct iomap_page *iop = iomap_page_create(inode, page);
> loff_t block_size = i_blocksize(inode);
> - loff_t block_start = pos & ~(block_size - 1);
> - loff_t block_end = (pos + len + block_size - 1) & ~(block_size - 1);
> + loff_t block_start = round_down(pos, block_size);
> + loff_t block_end = round_up(pos + len, block_size);
> unsigned from = offset_in_page(pos), to = from + len, poff, plen;
> int status;
>
> --
> 2.17.1
>
prev parent reply other threads:[~2020-09-10 19:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 12:47 [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin Nikolay Borisov
2020-09-10 15:37 ` Darrick J. Wong [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=20200910153701.GC7964@magnolia \
--to=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nborisov@suse.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).