<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/filelayout, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-04T12:32:37Z</updated>
<entry>
<title>nfs: don't share pNFS DS connections between net namespaces</title>
<updated>2025-06-04T12:32:37Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2025-04-10T20:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c04f5dc4c322257df2389c80b43ad10ac618d147'/>
<id>urn:sha1:c04f5dc4c322257df2389c80b43ad10ac618d147</id>
<content type='text'>
[ Upstream commit 6b9785dc8b13d9fb75ceec8cf4ea7ec3f3b1edbc ]

Currently, different NFS clients can share the same DS connections, even
when they are in different net namespaces. If a containerized client
creates a DS connection, another container can find and use it. When the
first client exits, the connection will close which can lead to stalls
in other clients.

Add a net namespace pointer to struct nfs4_pnfs_ds, and compare those
value to the caller's netns in _data_server_lookup_locked() when
searching for a nfs4_pnfs_ds to match.

Reported-by: Omar Sandoval &lt;osandov@osandov.com&gt;
Reported-by: Sargun Dillon &lt;sargun@sargun.me&gt;
Closes: https://lore.kernel.org/linux-nfs/Z_ArpQC_vREh_hEA@telecaster/
Tested-by: Sargun Dillon &lt;sargun@sargun.me&gt;
Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Reviewed-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Link: https://lore.kernel.org/r/20250410-nfs-ds-netns-v2-1-f80b7979ba80@kernel.org
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pNFS/filelayout: Fix coalescing test for single DS</title>
<updated>2023-01-24T06:17:58Z</updated>
<author>
<name>Olga Kornievskaia</name>
</author>
<published>2022-12-20T17:31:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a869f7b0541174ee1e3b19df535cea0d29bbbbda'/>
<id>urn:sha1:a869f7b0541174ee1e3b19df535cea0d29bbbbda</id>
<content type='text'>
[ Upstream commit a6b9d2fa0024e7e399c26facd0fb466b7396e2b9 ]

When there is a single DS no striping constraints need to be placed on
the IO. When such constraint is applied then buffered reads don't
coalesce to the DS's rsize.

Signed-off-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFS: fix an incorrect limit in filelayout_decode_layout()</title>
<updated>2021-06-03T06:59:06Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-05-11T08:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e411df81cd862ef3d5b878120b2a2fef0ca9cdb1'/>
<id>urn:sha1:e411df81cd862ef3d5b878120b2a2fef0ca9cdb1</id>
<content type='text'>
commit 769b01ea68b6c49dc3cde6adf7e53927dacbd3a8 upstream.

The "sizeof(struct nfs_fh)" is two bytes too large and could lead to
memory corruption.  It should be NFS_MAXFHSIZE because that's the size
of the -&gt;data[] buffer.

I reversed the size of the arguments to put the variable on the left.

Fixes: 16b374ca439f ("NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pNFS/filelayout: enable LAYOUTGET on OPEN</title>
<updated>2019-09-24T20:28:38Z</updated>
<author>
<name>Olga Kornievskaia</name>
</author>
<published>2019-09-10T21:14:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8fd0feeca35cb8f9ddd950191f4aeb777f52f89'/>
<id>urn:sha1:a8fd0feeca35cb8f9ddd950191f4aeb777f52f89</id>
<content type='text'>
Add the flag to the filelayout driver to add LAYOUTGET to
the OPEN compound.

Signed-off-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier - Makefile/Kconfig</title>
<updated>2019-05-21T08:50:46Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-19T12:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1'/>
<id>urn:sha1:ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1</id>
<content type='text'>
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>PNFS fallback to MDS if no deviceid found</title>
<updated>2019-05-09T20:24:56Z</updated>
<author>
<name>Olga Kornievskaia</name>
</author>
<published>2019-05-07T17:41:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b1029c9bc078a6f1515f55dd993b507dcc7e3440'/>
<id>urn:sha1:b1029c9bc078a6f1515f55dd993b507dcc7e3440</id>
<content type='text'>
If we fail to find a good deviceid while trying to pnfs instead of
propogating an error back fallback to doing IO to the MDS. Currently,
code with fals the IO with EINVAL.

Signed-off-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Fixes: 8d40b0f14846f ("NFS filelayout:call GETDEVICEINFO after pnfs_layout_process completes"
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>NFS: Add a helper to return a pointer to the open context of a struct nfs_page</title>
<updated>2019-04-25T18:18:15Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2019-04-07T17:59:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fcd5960e88bbdc74a70d9e3a5ab46b489fc4b80'/>
<id>urn:sha1:9fcd5960e88bbdc74a70d9e3a5ab46b489fc4b80</id>
<content type='text'>
Add a helper for when we remove the explicit pointer to the open
context.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>pNFS: Don't allocate more pages than we need to fit a layoutget response</title>
<updated>2018-09-30T19:35:16Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2018-09-03T17:12:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28ced9a84cd2f9fc68a081fb3b34e70c5d459be3'/>
<id>urn:sha1:28ced9a84cd2f9fc68a081fb3b34e70c5d459be3</id>
<content type='text'>
For the 'files' and 'flexfiles' layout types, we do not expect the reply
to be any larger than 4k. The block and scsi layout types are a little more
greedy, so we keep allocating the maximum response size for now.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE</title>
<updated>2018-01-18T17:51:31Z</updated>
<author>
<name>Tigran Mkrtchyan</name>
</author>
<published>2018-01-16T21:38:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ff4cff637aa0bd2abbd81f53b2a6206c50afd95'/>
<id>urn:sha1:7ff4cff637aa0bd2abbd81f53b2a6206c50afd95</id>
<content type='text'>
A pNFS server may return LAYOUTUNAVAILABLE error on LAYOUTGET for files
which don't have any layout. In this situation pnfs_update_layout
currently returns NULL. As this NULL is converted into ENOMEM, IO
requests fails instead of falling back to MDS.

Do not return ENOMEM on LAYOUTUNAVAILABLE and let client retry through
MDS.

Fixes 8d40b0f14846f. I will suggest to backport this fix to affected
stable branches.

Signed-off-by: Tigran Mkrtchyan &lt;tigran.mkrtchyan@desy.de&gt;
[trondmy: Use IS_ERR_OR_NULL()]
Fixes: 8d40b0f14846 ("NFS filelayout:call GETDEVICEINFO after...")
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>fs, nfs: convert nfs_client.cl_count from atomic_t to refcount_t</title>
<updated>2017-11-17T18:48:01Z</updated>
<author>
<name>Elena Reshetova</name>
</author>
<published>2017-10-20T09:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=212bf41d88c06afc23e03f9b274eebf1e8dba197'/>
<id>urn:sha1:212bf41d88c06afc23e03f9b274eebf1e8dba197</id>
<content type='text'>
atomic_t variables are currently used to implement reference
counters with the following properties:
 - counter is initialized to 1 using atomic_set()
 - a resource is freed upon counter reaching zero
 - once counter reaches zero, its further
   increments aren't allowed
 - counter schema uses basic atomic operations
   (set, inc, inc_not_zero, dec_and_test, etc.)

Such atomic variables should be converted to a newly provided
refcount_t type and API that prevents accidental counter overflows
and underflows. This is important since overflows and underflows
can lead to use-after-free situation and be exploitable.

The variable nfs_client.cl_count is used as pure reference counter.
Convert it to refcount_t and fix up the operations.

Suggested-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: David Windsor &lt;dwindsor@gmail.com&gt;
Reviewed-by: Hans Liljestrand &lt;ishkamiel@gmail.com&gt;
Signed-off-by: Elena Reshetova &lt;elena.reshetova@intel.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
</feed>
