From: Benjamin Coddington <bcodding@redhat.com>
To: Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>, Tejun Heo <tj@kernel.org>,
Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
djeffery@redhat.com, loberman@redhat.com
Subject: [PATCH 0/2] Fix loopback mounted filesystems on NFS
Date: Mon, 7 Jul 2025 14:46:02 -0400 [thread overview]
Message-ID: <cover.1751913604.git.bcodding@redhat.com> (raw)
We've been investigating new reports of filesystem corruption on
loopback images on NFS clients. It appears that during writeback the
loopback driver encounters allocation failures in NFS and fails to write
dirty pages to the backing file.
We believe the problem is due to the loopback driver performing writeback
from a workqueue (so PF_WQ_WORKER is set), however ever since work to
improve NFS' memory allocation strategies [1] its possible that NFS
incorrectly assumes that if PF_WQ_WORKER is set then the writeback context
is nfsiod. To make things worse, NFS does not expect PF_WQ_WORKER to be set
along with other PF_ flags such as PF_MEMALLOC_NOIO, but cannot really know
(without checking them all) which other allocation flags are set should
writeback be entered from a NFS-external workqueue worker.
To fix this, I'd like to introduce a way to check which specific workqueue
is being served by a worker (in patch 1), so that NFS can ensure that it
sets certain allocation flags only for the nfsiod workqueue workers (in
patch 2).
[1]: https://lore.kernel.org/linux-nfs/20220322011618.1052288-1-trondmy@kernel.org/
Benjamin Coddington (2):
workqueue: Add a helper to identify current workqueue
NFS: Improve nfsiod workqueue detection for allocation flags
fs/nfs/internal.h | 12 +++++++++++-
include/linux/workqueue.h | 1 +
kernel/workqueue.c | 18 ++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
--
2.47.0
next reply other threads:[~2025-07-07 18:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 18:46 Benjamin Coddington [this message]
2025-07-07 18:46 ` [PATCH 1/2] workqueue: Add a helper to identify current workqueue Benjamin Coddington
2025-07-08 4:37 ` Tejun Heo
2025-07-08 10:25 ` Benjamin Coddington
2025-07-07 18:46 ` [PATCH 2/2] NFS: Improve nfsiod workqueue detection for allocation flags Benjamin Coddington
2025-07-07 19:25 ` Trond Myklebust
2025-07-07 20:12 ` Benjamin Coddington
2025-07-07 20:42 ` Trond Myklebust
2025-07-07 20:28 ` Laurence Oberman
2025-07-08 16:50 ` Laurence Oberman
2025-07-08 17:03 ` Benjamin Coddington
2025-07-08 17:09 ` Laurence Oberman
2025-07-07 19:15 ` [PATCH 0/2] Fix loopback mounted filesystems on NFS 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=cover.1751913604.git.bcodding@redhat.com \
--to=bcodding@redhat.com \
--cc=anna@kernel.org \
--cc=djeffery@redhat.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=loberman@redhat.com \
--cc=tj@kernel.org \
--cc=trondmy@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).