|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14 |
|
| #
2d066800 |
| 18-Mar-2025 |
Joanne Koong <[email protected]> |
fuse: remove unneeded atomic set in uring creation
When the ring is allocated, it is kzalloc-ed. ring->queue_refs will already be initialized to 0 by default. It does not need to be atomically set t
fuse: remove unneeded atomic set in uring creation
When the ring is allocated, it is kzalloc-ed. ring->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 <[email protected]> Reviewed-by: Bernd Schubert <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
1dfe2a22 |
| 18-Mar-2025 |
Joanne Koong <[email protected]> |
fuse: fix uring race condition for null dereference of fc
There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->lock in fuse_uring_create_queue().
fuse: fix uring race condition for null dereference of fc
There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->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->ring but has not yet set ring->fc when fuse_uring_create_queue() reads ring->fc. There is another race condition as well where in fuse_uring_register(), ring->nr_queues may still be 0 and not yet set to the new value when we compare qid against it.
This fix sets fc->ring only after ring->fc and ring->nr_queues have been set, which guarantees now that ring->fc is a proper pointer when any queues are created and ring->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->ring is assigned only after ring->fc and ring->nr_queues have been assigned.
Signed-off-by: Joanne Koong <[email protected]> Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands") Reviewed-by: Bernd Schubert <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1 |
|
| #
0f6439f6 |
| 22-Jan-2025 |
Joanne Koong <[email protected]> |
fuse: add kernel-enforced timeout option for requests
There are situations where fuse servers can become unresponsive or stuck, for example if the server is deadlocked. Currently, there's no good wa
fuse: add kernel-enforced timeout option for requests
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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
09098e62 |
| 25-Mar-2025 |
Bernd Schubert <[email protected]> |
fuse: {io-uring} Fix a possible req cancellation race
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 t
fuse: {io-uring} Fix a possible req cancellation race
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->lock and so might race with task-A.
For scaling reasons we better don't use fiq->lock, but add a handler to remove canceled requests from the queue.
This also removes usage of fiq->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: <[email protected]> # v6.14 Reported-by: Joanne Koong <[email protected]> Closes: https://lore.kernel.org/all/CAJnrk1ZgHNb78dz-yfNTpxmW7wtT88A=m-zF0ZoLXKLUHRjNTw@mail.gmail.com/ Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Joanne Koong <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
d9ecc771 |
| 18-Mar-2025 |
Joanne Koong <[email protected]> |
fuse: fix uring race condition for null dereference of fc
There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->lock in fuse_uring_create_queue().
fuse: fix uring race condition for null dereference of fc
There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->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->ring but has not yet set ring->fc when fuse_uring_create_queue() reads ring->fc. There is another race condition as well where in fuse_uring_register(), ring->nr_queues may still be 0 and not yet set to the new value when we compare qid against it.
This fix sets fc->ring only after ring->fc and ring->nr_queues have been set, which guarantees now that ring->fc is a proper pointer when any queues are created and ring->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->ring is assigned only after ring->fc and ring->nr_queues have been assigned.
Signed-off-by: Joanne Koong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands") Acked-by: Miklos Szeredi <[email protected]> Reviewed-by: Bernd Schubert <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
show more ...
|
| #
2d4fde59 |
| 23-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: prevent disabling io-uring on active connections
The enable_uring module parameter allows administrators to enable/disable io-uring support for FUSE at runtime. However, disabling io-uring whi
fuse: prevent disabling io-uring on active connections
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 <[email protected]> Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
786412a7 |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: enable fuse-over-io-uring
All required parts are handled now, fuse-io-uring can be enabled.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]
fuse: enable fuse-over-io-uring
All required parts are handled now, fuse-io-uring can be enabled.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
3393ff96 |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: block request allocation until io-uring init is complete
Avoid races and block request allocation until io-uring queues are ready.
This is a especially important for background requests, as b
fuse: block request allocation until io-uring init is complete
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->lock and then fc->bg_lock
fuse_request_end spin_lock(&fc->bg_lock); flush_bg_queue fuse_send_one fuse_uring_queue_fuse_req spin_lock(&queue->lock);
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
b6236c84 |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: {io-uring} Prevent mount point hang on fuse-server termination
When the fuse-server terminates while the fuse-client or kernel still has queued URING_CMDs, these commands retain references to
fuse: {io-uring} Prevent mount point hang on fuse-server termination
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 <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
857b0263 |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: Allow to queue bg requests through io-uring
This prepares queueing and sending background requests through io-uring.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begun
fuse: Allow to queue bg requests through io-uring
This prepares queueing and sending background requests through io-uring.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
c2c9af9a |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: Allow to queue fg requests through io-uring
This prepares queueing and sending foreground requests through io-uring.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begun
fuse: Allow to queue fg requests through io-uring
This prepares queueing and sending foreground requests through io-uring.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
4a9bfb9b |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: {io-uring} Handle teardown of ring entries
On teardown struct file_operations::uring_cmd requests need to be completed by calling io_uring_cmd_done(). Not completing all ring entries would res
fuse: {io-uring} Handle teardown of ring entries
On teardown struct file_operations::uring_cmd requests need to be completed by calling io_uring_cmd_done(). Not completing all ring entries would result in busy io-uring tasks giving warning messages in intervals and unreleased struct file.
Additionally the fuse connection and with that the ring can only get released when all io-uring commands are completed.
Completion is done with ring entries that are a) in waiting state for new fuse requests - io_uring_cmd_done is needed
b) already in userspace - io_uring_cmd_done through teardown is not needed, the request can just get released. If fuse server is still active and commits such a ring entry, fuse_uring_cmd() already checks if the connection is active and then complete the io-uring itself with -ENOTCONN. I.e. special handling is not needed.
This scheme is basically represented by the ring entry state FRRS_WAIT and FRRS_USERSPACE.
Entries in state: - FRRS_INIT: No action needed, do not contribute to ring->queue_refs yet - All other states: Are currently processed by other tasks, async teardown is needed and it has to wait for the two states above. It could be also solved without an async teardown task, but would require additional if conditions in hot code paths. Also in my personal opinion the code looks cleaner with async teardown.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
c090c8ab |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: Add io-uring sqe commit and fetch support
This adds support for fuse request completion through ring SQEs (FUSE_URING_CMD_COMMIT_AND_FETCH handling). After committing the ring entry it becomes
fuse: Add io-uring sqe commit and fetch support
This adds support for fuse request completion through ring SQEs (FUSE_URING_CMD_COMMIT_AND_FETCH handling). After committing the ring entry it becomes available for new fuse requests. Handling of requests through the ring (SQE/CQE handling) is complete now.
Fuse request data are copied through the mmaped ring buffer, there is no support for any zero copy yet.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|
| #
24fe962c |
| 20-Jan-2025 |
Bernd Schubert <[email protected]> |
fuse: {io-uring} Handle SQEs - register commands
This adds basic support for ring SQEs (with opcode=IORING_OP_URING_CMD). For now only FUSE_IO_URING_CMD_REGISTER is handled to register queue entries
fuse: {io-uring} Handle SQEs - register commands
This adds basic support for ring SQEs (with opcode=IORING_OP_URING_CMD). For now only FUSE_IO_URING_CMD_REGISTER is handled to register queue entries.
Signed-off-by: Bernd Schubert <[email protected]> Reviewed-by: Pavel Begunkov <[email protected]> # io_uring Reviewed-by: Luis Henriques <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
show more ...
|