Skip to content

Commit 2a889c7

Browse files
committed
fuse: Add memory barrier in fuse_uring_destruct
Add an smp_rmb() before checking list states in fuse_uring_destruct() to ensure proper ordering between list modifications and emptiness checks. During connection teardown lists are checked without holding a lock, and ithout this barrier, the CPU executing fuse_uring_destruct() might see inconsistent list states, leading to false WARN_ON triggers even though the lists have been properly emptied. The smp_rmb() ensures we see the final consistent state of all lists after teardown operations complete on other CPUs. This fixes occasional false WARN_ON triggers during connection teardown. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
1 parent 5f0264c commit 2a889c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/fuse/dev_uring.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ void fuse_uring_destruct(struct fuse_conn *fc)
188188
if (!queue)
189189
continue;
190190

191+
/* memory barrier to ensure we see the latest list state */
192+
smp_rmb();
193+
191194
WARN_ON(!list_empty(&queue->ent_avail_queue));
192195
WARN_ON(!list_empty(&queue->ent_w_req_queue));
193196
WARN_ON(!list_empty(&queue->ent_commit_queue));

0 commit comments

Comments
 (0)