Skip to content

Fix loopback mounted filesystems on NFS

Benjamin Coddington linux-nfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2workqueue: Add a helper to identify current workqueueinclude/linux/workqueue.h kernel/workqueue.c+19 -02 replies
2/2NFS: Improve nfsiod workqueue detection for allocation flagsfs/nfs/internal.h+11 -18 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJeff LaytonLaurence Oberman
SeriesR-b
1/2
2/2T-b R-b T-b R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Fix loopback mounted filesystems on NFS

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/[email protected]/

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(-)
Signature · 1 line
2.47.0