linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: JeffleXu <jefflexu@linux.alibaba.com>
To: David Howells <dhowells@redhat.com>, willy@infradead.org
Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com,
	Jeff Layton <jlayton@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [Linux-cachefs] [PATCH v2 2/2] netfs: Fix dodgy maths
Date: Wed, 9 Nov 2022 13:35:25 +0800	[thread overview]
Message-ID: <af8490c5-524c-69a8-d128-d0c70a3deb76@linux.alibaba.com> (raw)
In-Reply-To: <166757988611.950645.7626959069846893164.stgit@warthog.procyon.org.uk>



On 11/5/22 12:38 AM, David Howells wrote:
> Fix the dodgy maths in netfs_rreq_unlock_folios().  start_page could be
> inside the folio, in which case the calculation of pgpos will be come up
> with a negative number (though for the moment rreq->start is rounded down
> earlier and folios would have to get merged whilst locked)
> 
> Alter how this works to just frame the tracking in terms of absolute file
> positions, rather than offsets from the start of the I/O request.  This
> simplifies the maths and makes it easier to follow.
> 
> Fix the issue by using folio_pos() and folio_size() to calculate the end
> position of the page.
> 
> Fixes: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")
> Reported-by: Matthew Wilcox <willy@infradead.org>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Jeff Layton <jlayton@kernel.org>
> cc: linux-cachefs@redhat.com
> cc: linux-fsdevel@vger.kernel.org
> Link: https://lore.kernel.org/r/Y2SJw7w1IsIik3nb@casper.infradead.org/

Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com>

-- 
Thanks,
Jingbo

  parent reply	other threads:[~2022-11-09  5:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 16:37 [PATCH v2 1/2] netfs: Fix missing xas_retry() calls in xarray iteration David Howells
2022-11-04 16:38 ` [PATCH v2 2/2] netfs: Fix dodgy maths David Howells
2022-11-08  5:54   ` JeffleXu
2022-11-08 15:59   ` David Howells
2022-11-09  5:35   ` JeffleXu [this message]
2022-11-14 21:26   ` [Linux-cachefs] " Jeff Layton
2022-11-08  3:28 ` [Linux-cachefs] [PATCH v2 1/2] netfs: Fix missing xas_retry() calls in xarray iteration JeffleXu

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=af8490c5-524c-69a8-d128-d0c70a3deb76@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.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).