Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795911096; b=a9P3Ts8TmA10qpyWfTI6Ll22/tI6BKs602IUZa/H56vkCsEoW/lb3Y6os+UaHyrK5DL3 POLoIpttSay3ivSk27AJGyhy6kG214+YuotKge3/g2aCuzTgtBEQ1excN/3ttcQ1Tb9aD RmKajaUuVhvrEkHXqyV5rtEtXMulJ0QfiUcQgnZBi4h5fNO/bWZ3iCEmxB/86kxLWyAVu x/eLom45ijAYXAyg5iKJQgSu5gYsnJH1tpKfV94ZaECpN6/RwYZq/NpwG4n1+R2ca+A75 z4FNvpxKvFVA5Va9UDIwDbOxb7plRIWNF8movSCDosYykhPmGjmBRi7WwCs7MdNCu2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795911096; h=Received:DKIM-Signature:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version; bh=/bzl0v6K9Fz6Aa9fekglWQxR7BT7DGNXmxRGJ7gJxnQ=; b=kBsCxS8hkc0gu+p2JF4hoFQemLW06zgGDgpvnr35Yv1z16yJddBZLEGvX8/QFwYyVRR0 IAgLl1o41xyMks0+G+fSKbr+B63HNihh4gDde2WD3kaDtW0q0jHdZMcePRSXwBcGMTwgB oQZtMaHYb6+hqduMLf7fbDxUGVhELqPgjCxJlBz1tU1bazaJfDW2Ww1sk4ygB+nCDYLzz bq/Esnf/HBcH8KtAy+KR+0kpB5mJRU31+Urv27YbESTGYGhj9dZPie74QicDDM9epzP48 HacR0Bqxlv/xIfgZbBO6LcmHCBI0u1dXusthXirG1KsXWRMx2Jf+EzLt01xHr4oegWQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h9ex5UBl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B31FD606A31C for ; Sun, 29 Nov 2026 00:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h9ex5UBl Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D17F1F00897; Sun, 29 Nov 2026 00:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795911096; bh=/bzl0v6K9Fz6Aa9fekglWQxR7BT7DGNXmxRGJ7gJxnQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=h9ex5UBlTaJxm1jwAbb6BhMzQxeDeYpf8/9jWZvrXZbZp3pkVnWushC/9fMYKzN1F 0mXCgd+CDVBVtrhjL5tVni1xKS7RZ4XSGGDlJFbfdbFiU+8ipOY7EhQUTpMXU5XlU4 320dB3qG0X8Qz1LqnAcYG9raE6JNZTdsjY40AM6uCzCXvH37b9ocjIY5aV7EY3hE+k JJhGzYnSFVv8SFI3KCFblAc3rONkpJEvumww6l9bV+OrqjtTKpDK60XOuyyU3u/roo 18OyoRLigbxnYJTIoYqW3GFckn5aJm+2uHBTagRBCgM1E2r1STUExd7Mgy7Fi5ME64 nK0l1zuHsS76A== Message-ID: Subject: Re: [PATCH v3 1/5] pNFS/flexfiles: use the MDS for locked-folio writeback without a layout From: Trond Myklebust To: Benjamin Coddington , Anna Schumaker , Mike Snitzer Cc: linux-nfs@vger.kernel.org Date: Sat, 28 Nov 2026 19:11:35 -0500 In-Reply-To: <81fea5dcd8feebcf1590effad8b96648b288bb11.1795122900.git.bcodding@hammerspace.com> References: <81fea5dcd8feebcf1590effad8b96648b288bb11.1795122900.git.bcodding@hammerspace.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.62.1 (3.62.1-1.fc45) X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Fri, 2026-11-20 at 11:09 -0500, Benjamin Coddington wrote: > From: Benjamin Coddington >=20 > nfs_writepage_locked() writes back one folio that its caller holds > locked, for nfs_wb_folio(), nfs_wb_folio_reclaim() and migration.=C2=A0 > When > there is no layout segment and the file's layout header carries > FF_FLAGS_NO_IO_THRU_MDS, ff_layout_pg_get_mirror_count_write() > refuses > the write with -EAGAIN.=C2=A0 nfs_do_writepage() redirties the folio and > returns the -EAGAIN, and nfs_wb_folio() passes it to > nfs_updatepage(), > nfs_flush_incompatible(), nfs_read_folio() and nfs_launder_folio().=C2=A0 > A > read(2) or write(2) on a blocking file then fails with EAGAIN, for > example when another open context has dirtied the same folio while a > layout is being recalled. >=20 > Resending from nfs_wb_folio(), as nfs_writepages() does, would hold > the > folio locked across the resends.=C2=A0 A bulk recall can't complete while > nfs_writepages() holds a layout segment, and nfs_writepages() would > be > waiting for that folio's lock. >=20 > FF_FLAGS_NO_IO_THRU_MDS is a hint (RFC 8435, section 5.1.2).=C2=A0 Mark > the > descriptor that nfs_writepage_locked() uses with a new pg_allow_mds > bit, and send its write through the MDS when there is no layout > segment.=C2=A0 When ff_layout_pg_init_write() can't use a data server, > send > such a write to the MDS too, instead of retrying with the folio > locked. >=20 > ff_layout_pg_init_write() switches a write to the MDS by resetting > the > descriptor and returning -EAGAIN, which nfs_wb_folio() also passes > up, > with or without the flag.=C2=A0 When nfs_wb_folio() gets -EAGAIN, wait fo= r > any part of the folio already under writeback, as its loop does, and > write the folio once more with a descriptor that goes straight to the > MDS.=C2=A0 nfs_wb_folio_reclaim() still returns the error, and > nfs_release_folio() keeps the folio. >=20 NACK. The spec is misleading, because it says "the client should not send I/O operations to the metadata server". That ought really to read as "the client SHOULD NOT send I/O operations to the metadata server". I.e. it should be using the IETF normative language. The point is that sending I/O though the MDS is likely to be detrimental to the overall functioning of the system, so don't do it! --=20 Trond Myklebust Linux NFS client maintainer, Hammerspace trondmy@kernel.org, trond.myklebust@hammerspace.com