[Devel] [PATCH hci-8.1 0/3] fs/fuse: rework close_wait handling

Liu Kui kui.liu at virtuozzo.com
Wed Sep 30 08:44:47 MSK 2026


Rework the close_wait handling around fuse file open/close:

 - give num_openers and i_size_unstable each a single role: the flag
   alone decides when attributes are taken from the server, the
   counter only drives kio's file_open/file_close pairing

 - move all the close_wait handling of fuse_release() into a new
   helper and restore the !close_wait case to the mainline behavior;
   the atomic last-open detection under the inode lock fixes two
   racing releasers both calling kio's file_close

 - decouple the releaser's wait for ff->count from fi->page_waitq:
   switch it to wait_var_event() and fold the matching wake_up_var()
   into fuse_file_put(), so the wakeup can never be separated from
   the reference drop again (see commit 3b2cc738990e ("fs/fuse: wake
   close_wait waiters when fuse_writepage_locked() bails out") for
   the most recent instance of a drop site missing the wakeup),
   removing __fuse_file_put() and fuse_release_ff()

https://virtuozzo.atlassian.net/browse/VSTOR-147878

---
Liu Kui (3):
      fs/fuse: give num_openers and i_size_unstable each a single role
      fs/fuse: move the close_wait handling of fuse_release() into a helper
      fs/fuse: use wait_var_event to wait for fuse file references

 fs/fuse/file.c                     | 177 +++++++++++++++++++------------------
 fs/fuse/fuse_i.h                   |   6 +-
 fs/fuse/inode.c                    |   5 +-
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c |   3 +-
 4 files changed, 101 insertions(+), 90 deletions(-)
---
base-commit: ca54f152160587a74ff17cb52feef16f7b9d4e2b
change-id: 20260928-close-wait-rework-v2-7cac44e6a295

Best regards,
--  
Liu Kui <kui.liu at virtuozzo.com>



More information about the Devel mailing list