From: David Howells <dhowells@redhat.com>
To: torvalds@linux-foundation.org
Cc: dhowells@redhat.com, willy@infradead.org,
Jeff Layton <jlayton@kernel.org>,
JeffleXu <jefflexu@linux.alibaba.com>,
linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [GIT PULL] netfs: Fix folio unmarking/unlocking loops
Date: Tue, 15 Nov 2022 21:19:29 +0000 [thread overview]
Message-ID: <1846994.1668547169@warthog.procyon.org.uk> (raw)
Hi Linus,
Could you pull these changes please? There are two, affecting the
functions that iterates over the pagecache unmarking or unlocking pages
after an op is complete:
(1) xas_for_each() loops must call xas_retry() first thing and immediately
do a "continue" in the case that the extracted value is a special
value that indicates that the walk raced with a modification. Fix the
unlock and unmark loops to do this.
(2) The maths in the unlock loop is dodgy as it could, theoretically, at
some point in the future end up with a starting file pointer that is
in the middle of a folio. This will cause a subtraction to go
negative - but the number is unsigned. Fix the maths to use absolute
file positions instead of relative page indices.
Thanks,
David
Link: https://lore.kernel.org/r/166749229733.107206.17482609105741691452.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/166757987929.950645.12595273010425381286.stgit@warthog.procyon.org.uk/ # v2
---
The following changes since commit f0c4d9fc9cc9462659728d168387191387e903cc:
Linux 6.1-rc4 (2022-11-06 15:07:11 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/netfs-fixes-20221115
for you to fetch changes up to 5e51c627c5acbcf82bb552e17533a79d2a6a2600:
netfs: Fix dodgy maths (2022-11-15 16:56:07 +0000)
----------------------------------------------------------------
netfslib fixes
----------------------------------------------------------------
David Howells (2):
netfs: Fix missing xas_retry() calls in xarray iteration
netfs: Fix dodgy maths
fs/netfs/buffered_read.c | 20 +++++++++++++-------
fs/netfs/io.c | 3 +++
2 files changed, 16 insertions(+), 7 deletions(-)
next reply other threads:[~2022-11-15 21:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 21:19 David Howells [this message]
2022-11-15 23:01 ` pr-tracker-bot
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=1846994.1668547169@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=jefflexu@linux.alibaba.com \
--cc=jlayton@kernel.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®