mbox series

[0/4] fuse: {io-uring} Ensure fuse requests are set/read with locks

Message ID 20250124-optimize-fuse-uring-req-timeouts-v1-0-b834b5f32e85@ddn.com (mailing list archive)
Headers show
Series fuse: {io-uring} Ensure fuse requests are set/read with locks | expand

Message

Bernd Schubert Jan. 24, 2025, 4:46 p.m. UTC
The timeout optimization patch Joanne had set ent->fuse_req to NULL
while holding a lock and that made me to realize we might have
a problem there.

And based on that, I believe we also need to set/read pdu->ent
with write,read_once.

Cc: Luis Henriques <luis@igalia.com>
Cc: Joanne Koong <joannelkoong@gmail.com>

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
---
Bernd Schubert (4):
      fuse: {io-uring} Use READ_ONCE in fuse_uring_send_in_task
      fuse: {io-uring} Access entries with queue lock in fuse_uring_entry_teardown
      fuse: {io-uring} set/read ent->fuse_req while holding a lock
      fuse: {io-uring} Use {WRITE,READ}_ONCE for pdu->ent

 fs/fuse/dev_uring.c | 89 +++++++++++++++++++++++++++--------------------------
 1 file changed, 46 insertions(+), 43 deletions(-)
---
base-commit: 9859b70e784b07f92196d1cef7cda4ace101fd33
change-id: 20250124-optimize-fuse-uring-req-timeouts-55190797c641

Best regards,

Comments

Bernd Schubert Jan. 24, 2025, 4:52 p.m. UTC | #1
On 1/24/25 17:46, Bernd Schubert wrote:
> The timeout optimization patch Joanne had set ent->fuse_req to NULL
> while holding a lock and that made me to realize we might have
> a problem there.
> 
> And based on that, I believe we also need to set/read pdu->ent
> with write,read_once.
> 
> Cc: Luis Henriques <luis@igalia.com>
> Cc: Joanne Koong <joannelkoong@gmail.com>
> 
> Signed-off-by: Bernd Schubert <bschubert@ddn.com>
> ---
> Bernd Schubert (4):
>       fuse: {io-uring} Use READ_ONCE in fuse_uring_send_in_task
>       fuse: {io-uring} Access entries with queue lock in fuse_uring_entry_teardown
>       fuse: {io-uring} set/read ent->fuse_req while holding a lock
>       fuse: {io-uring} Use {WRITE,READ}_ONCE for pdu->ent
> 

Hi Miklos,

I'm sorry, more fixes, I could have noticed this before :/ 

It would be possible to squash patch 2 and 3 into the initial patches,
but is hard to send as patch series on top of linux-next. Please let
me know if I shall try to split it further up and you you those
patches with instructions in which order to apply.


Thanks,
Bernd