From: no-reply@sashiko.virtuozzo.com
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
Liu Kui <kui.liu@virtuozzo.com>
Cc: azaitsev@virtuozzo.com, devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 2/3] fs/fuse: move the close_wait handling of fuse_release() into a helper
Date: Wed, 30 Sep 2026 05:49:37 +0000 [thread overview]
Message-ID: <010701a0f0dc801b-61d8ba36-d6df-43d5-bb4f-122c2a2b325b-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20260930-close-wait-rework-v2-v1-2-f8062178544a@virtuozzo.com>
> Move all the close_wait handling of fuse_release() into a new helper
> fuse_release_close_wait(), and restore the !close_wait case to the
> mainline behavior except the FMODE_WRITE check.
>
> Unify the code paths: unconditionally remove the file from
> fi->write_files and wait until we hold the last reference. Decrement
> fi->num_openers under the inode lock, which detects the last open.
> This fixes two racing releasers both reading num_openers == 0 and
> calling kio's file_close twice, possible because the decrement was
> done early under fi->lock while the check ran later under the inode
> lock:
>
> releaser A releaser B
> ---------- ----------
> --fi->num_openers (2 -> 1)
> --fi->num_openers (1 -> 0)
> inode_lock()
> num_openers == 0 -> file_close()
> inode_unlock()
> inode_lock()
> num_openers == 0 -> file_close()
>
> The atomic decrement under the inode lock also matches the increment
> in fuse_open_close_wait() for !writeback_cache files.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-147878
>
> Signed-off-by: Liu Kui <kui.liu@virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20260930-close-wait-rework-v2-v1-0-f8062178544a@virtuozzo.com?part=2
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-09-30 5:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 5:44 [Devel] [PATCH hci-8.1 0/3] fs/fuse: rework close_wait handling Liu Kui
2026-09-30 5:44 ` [Devel] [PATCH hci-8.1 1/3] fs/fuse: give num_openers and i_size_unstable each a single role Liu Kui
2026-09-30 5:50 ` no-reply
2026-09-30 5:44 ` [Devel] [PATCH hci-8.1 2/3] fs/fuse: move the close_wait handling of fuse_release() into a helper Liu Kui
2026-09-30 5:49 ` no-reply [this message]
2026-09-30 5:44 ` [Devel] [PATCH hci-8.1 3/3] fs/fuse: use wait_var_event to wait for fuse file references Liu Kui
2026-09-30 5:51 ` no-reply
2026-09-30 15:39 ` [Devel] [PATCH hci-8.1 0/3] fs/fuse: rework close_wait handling Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=010701a0f0dc801b-61d8ba36-d6df-43d5-bb4f-122c2a2b325b-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=azaitsev@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=kui.liu@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox