<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fuse/dev_uring.c, branch v6.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-04-15T11:43:38Z</updated>
<entry>
<title>fuse: optimize over-io-uring request expiration check</title>
<updated>2025-04-15T11:43:38Z</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2025-02-03T19:30:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4fea593e625cd50d4d11be227007849b12f17bfb'/>
<id>urn:sha1:4fea593e625cd50d4d11be227007849b12f17bfb</id>
<content type='text'>
Currently, when checking whether a request has timed out, we check
fpq processing, but fuse-over-io-uring has one fpq per core and 256
entries in the processing table. For systems where there are a
large number of cores, this may be too much overhead.

Instead of checking the fpq processing list, check ent_w_req_queue
and ent_in_userspace.

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Reviewed-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: use boolean bit-fields in struct fuse_copy_state</title>
<updated>2025-04-15T10:59:17Z</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2025-02-20T20:16:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03a3617f92c2a7220af20d5b6b44420049dbe6e3'/>
<id>urn:sha1:03a3617f92c2a7220af20d5b6b44420049dbe6e3</id>
<content type='text'>
Refactor struct fuse_copy_state to use boolean bit-fields to improve
clarity/readability and be consistent with other fuse structs that use
bit-fields for boolean state (eg fuse_fs_context, fuse_args).

No functional changes.

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: remove unneeded atomic set in uring creation</title>
<updated>2025-03-31T12:59:27Z</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2025-03-18T00:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d066800a4276340a97acc75c148892eb6f8781a'/>
<id>urn:sha1:2d066800a4276340a97acc75c148892eb6f8781a</id>
<content type='text'>
When the ring is allocated, it is kzalloc-ed. ring-&gt;queue_refs will
already be initialized to 0 by default. It does not need to be
atomically set to 0.

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Reviewed-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: fix uring race condition for null dereference of fc</title>
<updated>2025-03-31T12:59:27Z</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2025-03-18T00:30:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1dfe2a220e9cd85861a853b00d8620222b960c1f'/>
<id>urn:sha1:1dfe2a220e9cd85861a853b00d8620222b960c1f</id>
<content type='text'>
There is a race condition leading to a kernel crash from a null
dereference when attemping to access fc-&gt;lock in
fuse_uring_create_queue(). fc may be NULL in the case where another
thread is creating the uring in fuse_uring_create() and has set
fc-&gt;ring but has not yet set ring-&gt;fc when fuse_uring_create_queue()
reads ring-&gt;fc. There is another race condition as well where in
fuse_uring_register(), ring-&gt;nr_queues may still be 0 and not yet set
to the new value when we compare qid against it.

This fix sets fc-&gt;ring only after ring-&gt;fc and ring-&gt;nr_queues have been
set, which guarantees now that ring-&gt;fc is a proper pointer when any
queues are created and ring-&gt;nr_queues reflects the right number of
queues if ring is not NULL. We must use smp_store_release() and
smp_load_acquire() semantics to ensure the ordering will remain correct
where fc-&gt;ring is assigned only after ring-&gt;fc and ring-&gt;nr_queues have
been assigned.

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands")
Reviewed-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: add kernel-enforced timeout option for requests</title>
<updated>2025-03-31T12:59:25Z</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2025-01-22T21:55:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f6439f61a6e2ddc92b98362c6d1afc210f56a90'/>
<id>urn:sha1:0f6439f61a6e2ddc92b98362c6d1afc210f56a90</id>
<content type='text'>
There are situations where fuse servers can become unresponsive or
stuck, for example if the server is deadlocked. Currently, there's no
good way to detect if a server is stuck and needs to be killed manually.

This commit adds an option for enforcing a timeout (in seconds) for
requests where if the timeout elapses without the server responding to
the request, the connection will be automatically aborted.

Please note that these timeouts are not 100% precise. For example, the
request may take roughly an extra FUSE_TIMEOUT_TIMER_FREQ seconds beyond
the requested timeout due to internal implementation, in order to
mitigate overhead.

[SzM: Bump the API version number]

Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: {io-uring} Fix a possible req cancellation race</title>
<updated>2025-03-31T12:53:02Z</updated>
<author>
<name>Bernd Schubert</name>
<email>bschubert@ddn.com</email>
</author>
<published>2025-03-25T17:29:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09098e62e4be8f0755e58d6078aaf27cbd9a3a8d'/>
<id>urn:sha1:09098e62e4be8f0755e58d6078aaf27cbd9a3a8d</id>
<content type='text'>
task-A (application) might be in request_wait_answer and
try to remove the request when it has FR_PENDING set.

task-B (a fuse-server io-uring task) might handle this
request with FUSE_IO_URING_CMD_COMMIT_AND_FETCH, when
fetching the next request and accessed the req from
the pending list in fuse_uring_ent_assign_req().
That code path was not protected by fiq-&gt;lock and so
might race with task-A.

For scaling reasons we better don't use fiq-&gt;lock, but
add a handler to remove canceled requests from the queue.

This also removes usage of fiq-&gt;lock from
fuse_uring_add_req_to_ring_ent() altogether, as it was
there just to protect against this race and incomplete.

Also added is a comment why FR_PENDING is not cleared.

Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
Cc: &lt;stable@vger.kernel.org&gt; # v6.14
Reported-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Closes: https://lore.kernel.org/all/CAJnrk1ZgHNb78dz-yfNTpxmW7wtT88A=m-zF0ZoLXKLUHRjNTw@mail.gmail.com/
Signed-off-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: prevent disabling io-uring on active connections</title>
<updated>2025-01-27T17:02:23Z</updated>
<author>
<name>Bernd Schubert</name>
<email>bschubert@ddn.com</email>
</author>
<published>2025-01-23T16:55:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d4fde59fd502a65c1698b61ad4d0f10a9ab665a'/>
<id>urn:sha1:2d4fde59fd502a65c1698b61ad4d0f10a9ab665a</id>
<content type='text'>
The enable_uring module parameter allows administrators to enable/disable
io-uring support for FUSE at runtime. However, disabling io-uring while
connections already have it enabled can lead to an inconsistent state.

Fix this by keeping io-uring enabled on connections that were already using
it, even if the module parameter is later disabled. This ensures active
FUSE mounts continue to function correctly.

Signed-off-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Reviewed-by: Luis Henriques &lt;luis@igalia.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: enable fuse-over-io-uring</title>
<updated>2025-01-27T17:02:23Z</updated>
<author>
<name>Bernd Schubert</name>
<email>bschubert@ddn.com</email>
</author>
<published>2025-01-20T01:29:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=786412a73e7ee5b00ef3437bbf2f3a250759b2ae'/>
<id>urn:sha1:786412a73e7ee5b00ef3437bbf2f3a250759b2ae</id>
<content type='text'>
All required parts are handled now, fuse-io-uring can
be enabled.

Signed-off-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Reviewed-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt; # io_uring
Reviewed-by: Luis Henriques &lt;luis@igalia.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: block request allocation until io-uring init is complete</title>
<updated>2025-01-27T17:02:23Z</updated>
<author>
<name>Bernd Schubert</name>
<email>bernd@bsbernd.com</email>
</author>
<published>2025-01-20T01:29:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3393ff964e0fa5def66570c54a4612bf9df06b76'/>
<id>urn:sha1:3393ff964e0fa5def66570c54a4612bf9df06b76</id>
<content type='text'>
Avoid races and block request allocation until io-uring
queues are ready.

This is a especially important for background requests,
as bg request completion might cause lock order inversion
of the typical queue-&gt;lock and then fc-&gt;bg_lock

    fuse_request_end
       spin_lock(&amp;fc-&gt;bg_lock);
       flush_bg_queue
         fuse_send_one
           fuse_uring_queue_fuse_req
           spin_lock(&amp;queue-&gt;lock);

Signed-off-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Reviewed-by: Luis Henriques &lt;luis@igalia.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: {io-uring} Prevent mount point hang on fuse-server termination</title>
<updated>2025-01-27T17:02:21Z</updated>
<author>
<name>Bernd Schubert</name>
<email>bschubert@ddn.com</email>
</author>
<published>2025-01-20T01:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b6236c8407cba5d7a108facb1bcfab24994d3814'/>
<id>urn:sha1:b6236c8407cba5d7a108facb1bcfab24994d3814</id>
<content type='text'>
When the fuse-server terminates while the fuse-client or kernel
still has queued URING_CMDs, these commands retain references
to the struct file used by the fuse connection. This prevents
fuse_dev_release() from being invoked, resulting in a hung mount
point.

This patch addresses the issue by making queued URING_CMDs
cancelable, allowing fuse_dev_release() to proceed as expected
and preventing the mount point from hanging.

Signed-off-by: Bernd Schubert &lt;bschubert@ddn.com&gt;
Reviewed-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt; # io_uring
Reviewed-by: Luis Henriques &lt;luis@igalia.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
