-
Notifications
You must be signed in to change notification settings - Fork 7
fuse: fix fuse_uring_abort when uring is already cancelled #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,11 +157,10 @@ void fuse_uring_flush_bg(struct fuse_conn *fc) | |
| if (!queue) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't see why two runs are required. With one single lock, let's say we have two competing tasks, task-1 tries to add the request, task-2 tries to abort the queue. Scenario1: Scenario2:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it really that bad? this only gets called when the connection is destroyed.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somehow my previous comment disappeared, I had added that condition during development because issues came up. Just checked the code - it should be safe in current code. |
||
| continue; | ||
|
|
||
| queue->stopped = true; | ||
|
|
||
| WARN_ON_ONCE(ring->fc->max_background != UINT_MAX); | ||
| spin_lock(&queue->lock); | ||
| spin_lock(&fc->bg_lock); | ||
| queue->stopped = true; | ||
| fuse_uring_flush_queue_bg(queue); | ||
| spin_unlock(&fc->bg_lock); | ||
| spin_unlock(&queue->lock); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,10 +178,8 @@ static inline void fuse_uring_abort(struct fuse_conn *fc) | |
| if (ring == NULL) | ||
| return; | ||
|
|
||
| if (atomic_read(&ring->queue_refs) > 0) { | ||
| fuse_uring_flush_bg(fc); | ||
| fuse_uring_stop_queues(ring); | ||
| } | ||
| fuse_uring_flush_bg(fc); | ||
| fuse_uring_stop_queues(ring); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment is not right, queue_refs == 0 means there are no ring_ent on any queue - an impossible condition. And with queue_refs == 0, ring->ready will not be true.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is that an impossible condition? I have seen it many times in debug prints
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At startup time - > ring gets created, first queue gets created, then a ring-entry gets created (increases queue_refs), then ring->ready is set. teardown: fuse_uring_teardown_entries Btw, if there would be a problem with FRRS_FUSE_REQ and FRRS_COMMIT, queue refs would never go to 0 - exactly here. Anyway, fuse_uring_teardown_entries() is called by
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes ... that's why I had done those above (maybe in a bit of dispair) ... we have queue_refs == 0, and queue ready, and still requests active that will never terminate.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, all I want here is to call fuse_flush_bg() and fuse_uring_stop_queues() no matter what. What is wrong with that? |
||
| } | ||
|
|
||
| static inline void fuse_uring_wait_stopped_queues(struct fuse_conn *fc) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.