<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/9p/trans_virtio.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-11-03T07:49:53Z</updated>
<entry>
<title>9p: convert to the new mount API</title>
<updated>2025-11-03T07:49:53Z</updated>
<author>
<name>Eric Sandeen</name>
</author>
<published>2025-10-10T21:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f3e4142c0eb178089ea0cbc97506a061470ad27'/>
<id>urn:sha1:1f3e4142c0eb178089ea0cbc97506a061470ad27</id>
<content type='text'>
Convert 9p to the new mount API. This patch consolidates all parsing
into fs/9p/v9fs.c, which stores all results into a filesystem context
which can be passed to the various transports as needed.

Some of the parsing helper functions such as get_cache_mode() have been
eliminated in favor of using the new mount API's enum param type,
for simplicity.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Message-ID: &lt;20251010214222.1347785-5-sandeen@redhat.com&gt;
[ Dominique: handled source explicitly as per follow-up discussion ]
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>net/9p: cleanup: change p9_trans_module-&gt;def to bool</title>
<updated>2025-11-03T07:49:29Z</updated>
<author>
<name>Dominique Martinet</name>
</author>
<published>2025-10-31T07:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eeaf38a798aff6384983e5a0ac464d146de7ff55'/>
<id>urn:sha1:eeaf38a798aff6384983e5a0ac464d146de7ff55</id>
<content type='text'>
'-&gt;def' is only ever used as a true/false flag

Reported-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Message-ID: &lt;20251103-v9fs_trans_def_bool-v1-1-f33dc7ed9e81@codewreck.org&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>9p: Use kvmalloc for message buffers on supported transports</title>
<updated>2025-11-03T07:41:24Z</updated>
<author>
<name>Pierre Barre</name>
</author>
<published>2025-10-16T13:58:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e21d451a82f39e91b7635c4fc3ff5ac082873ec3'/>
<id>urn:sha1:e21d451a82f39e91b7635c4fc3ff5ac082873ec3</id>
<content type='text'>
While developing a 9P server (https://github.com/Barre/ZeroFS) and
testing it under high-load, I was running into allocation failures.
The failures occur even with plenty of free memory available because
kmalloc requires contiguous physical memory.

This results in errors like:
ls: page allocation failure: order:7, mode:0x40c40(GFP_NOFS|__GFP_COMP)

This patch introduces a transport capability flag (supports_vmalloc)
that indicates whether a transport can work with vmalloc'd buffers
(non-physically contiguous memory). Transports requiring DMA should
leave this flag as false.

The fd-based transports (tcp, unix, fd) set this flag to true, and
p9_fcall_init will use kvmalloc instead of kmalloc for these
transports. This allows the allocator to fall back to vmalloc when
contiguous physical memory is not available.

Additionally, if kmem_cache_alloc fails, the code falls back to
kvmalloc for transports that support it.

Signed-off-by: Pierre Barre &lt;pierre@barre.sh&gt;
Reviewed-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Message-ID: &lt;d2017c29-11fb-44a5-bd0f-4204329bbefb@app.fastmail.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>net: 9p: virtio: drop owner assignment</title>
<updated>2024-05-22T12:31:17Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2024-03-31T08:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d26dd255ce44e325e163ff3ce53423d26911ad11'/>
<id>urn:sha1:d26dd255ce44e325e163ff3ce53423d26911ad11</id>
<content type='text'>
virtio core already sets the .owner, so driver does not need to.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;

Message-Id: &lt;20240331-module-owner-virtio-v2-18-98f04bfaf46a@linaro.org&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>9p: virtio: skip incrementing unused variable</title>
<updated>2023-07-20T19:14:50Z</updated>
<author>
<name>Dominique Martinet</name>
</author>
<published>2023-05-03T07:49:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f41b402d2572e93bee85669ed05eb5e1f3725704'/>
<id>urn:sha1:f41b402d2572e93bee85669ed05eb5e1f3725704</id>
<content type='text'>
Fix the following scan-build warning:
net/9p/trans_virtio.c:504:3: warning: Value stored to 'in' is never read [deadcode.DeadStores]
                in += pack_sg_list_p(chan-&gt;sg, out + in, VIRTQUEUE_NUM,
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm honestly not 100% sure about this one; I'm tempted to think we
could (should?) just check the return value of pack_sg_list_p to skip
the in_sgs++ and setting sgs[] if it didn't process anything, but I'm
not sure it should ever happen so this is probably fine as is.

Just removing the assignment at least makes it clear the return value
isn't used, so it's an improvement in terms of readability.

Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@kernel.org&gt;
</content>
</entry>
<entry>
<title>9p: virtio: make sure 'offs' is initialized in zc_request</title>
<updated>2023-07-20T19:14:50Z</updated>
<author>
<name>Dominique Martinet</name>
</author>
<published>2023-05-03T07:49:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a73edab69d3a6623f03817fe950a2d9585f80e4'/>
<id>urn:sha1:4a73edab69d3a6623f03817fe950a2d9585f80e4</id>
<content type='text'>
Similarly to the previous patch: offs can be used in handle_rerrors
without initializing on small payloads; in this case handle_rerrors will
not use it because of the size check, but it doesn't hurt to make sure
it is zero to please scan-build.

This fixes the following warning:
net/9p/trans_virtio.c:539:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage]
                handle_rerror(req, in_hdr_len, offs, in_pages);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@kernel.org&gt;
</content>
</entry>
<entry>
<title>9p: virtio: fix unlikely null pointer deref in handle_rerror</title>
<updated>2023-07-20T19:14:50Z</updated>
<author>
<name>Dominique Martinet</name>
</author>
<published>2023-05-03T07:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13ade4ac5c28e8a014fa85278f5a4270b215f906'/>
<id>urn:sha1:13ade4ac5c28e8a014fa85278f5a4270b215f906</id>
<content type='text'>
handle_rerror can dereference the pages pointer, but it is not
necessarily set for small payloads.
In practice these should be filtered out by the size check, but
might as well double-check explicitly.

This fixes the following scan-build warnings:
net/9p/trans_virtio.c:401:24: warning: Dereference of null pointer [core.NullDereference]
                memcpy_from_page(to, *pages++, offs, n);
                                     ^~~~~~~~
net/9p/trans_virtio.c:406:23: warning: Dereference of null pointer (loaded from variable 'pages') [core.NullDereference]
        memcpy_from_page(to, *pages, offs, size);
                             ^~~~~~

Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
Signed-off-by: Eric Van Hensbergen &lt;ericvh@kernel.org&gt;
</content>
</entry>
<entry>
<title>9p/client: fix data race on req-&gt;status</title>
<updated>2022-12-13T04:02:15Z</updated>
<author>
<name>Dominique Martinet</name>
</author>
<published>2022-12-05T12:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a4f69ef15ec29b213e2b086b2502644e8ef76ee'/>
<id>urn:sha1:1a4f69ef15ec29b213e2b086b2502644e8ef76ee</id>
<content type='text'>
KCSAN reported a race between writing req-&gt;status in p9_client_cb and
accessing it in p9_client_rpc's wait_event.

Accesses to req itself is protected by the data barrier (writing req
fields, write barrier, writing status // reading status, read barrier,
reading other req fields), but status accesses themselves apparently
also must be annotated properly with WRITE_ONCE/READ_ONCE when we
access it without locks.

Follows:
 - error paths writing status in various threads all can notify
p9_client_rpc, so these all also need WRITE_ONCE
 - there's a similar read loop in trans_virtio for zc case that also
needs READ_ONCE
 - other reads in trans_fd should be protected by the trans_fd lock and
lists state machine, as corresponding writers all are within trans_fd
and should be under the same lock. If KCSAN complains on them we likely
will have something else to fix as well, so it's better to leave them
unmarked and look again if required.

Link: https://lkml.kernel.org/r/20221205124756.426350-1-asmadeus@codewreck.org
Reported-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Suggested-by: Marco Elver &lt;elver@google.com&gt;
Acked-by: Marco Elver &lt;elver@google.com&gt;
Reviewed-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>9p/net: Remove unneeded idr.h #include</title>
<updated>2022-12-02T14:59:20Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2022-11-27T14:46:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31fff92c9cadbca4cd294bcdff285ca3fc9bad7c'/>
<id>urn:sha1:31fff92c9cadbca4cd294bcdff285ca3fc9bad7c</id>
<content type='text'>
The 9p net files don't use IDR or IDA functionalities. So there is no point
in including &lt;linux/idr.h&gt;.
Remove it.

Link: https://lkml.kernel.org/r/9e386018601d7e4a9e5d7da8fc3e9555ebb25c87.1669560387.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Reviewed-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
<entry>
<title>net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module</title>
<updated>2022-10-04T22:05:41Z</updated>
<author>
<name>Christian Schoenebeck</name>
</author>
<published>2022-07-15T21:33:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=01d205d936ae18532e14814808592b926aacc6d5'/>
<id>urn:sha1:01d205d936ae18532e14814808592b926aacc6d5</id>
<content type='text'>
This is a preparatory change for the subsequent patch: the RDMA
transport pulls the buffers for its 9p response messages from a
shared pool. [1] So this case has to be considered when choosing
an appropriate response message size in the subsequent patch.

Link: https://lore.kernel.org/all/Ys3jjg52EIyITPua@codewreck.org/ [1]
Link: https://lkml.kernel.org/r/79d24310226bc4eb037892b5c097ec4ad4819a03.1657920926.git.linux_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck &lt;linux_oss@crudebyte.com&gt;
Signed-off-by: Dominique Martinet &lt;asmadeus@codewreck.org&gt;
</content>
</entry>
</feed>
