The commit is pushed to "branch-rh10-6.12.0-55.13.1.3.x.vz10-ovz" and will
appear at [email protected]:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.3.25.vz10
------>
commit e87a78589724a18763a51ef32b38ad630ae9f73b
Author: Liu Kui <[email protected]>
Date: Tue Dec 16 17:26:05 2025 +0800
fs/fuse kio: Set FUSE_S_FAIL_IMMEDIATELY bit on newly opened fuse_file
correctly
When fuse_invalidate_file() is in progress, set the FUSE_S_FAIL_IMMEDIATELY
bit on the newly created fuse_file before adding it to fi->rw_files list.
This prevents the page cache from issuing new read requests with locked
pages during fuse_invalidate_file(), which could otherwise cause a deadlock.
https://virtuozzo.atlassian.net/browse/VSTOR-120952
Signed-off-by: Liu Kui <[email protected]>
Acked-by: Alexey Kuznetsov <[email protected]>
Feature: vStorage
---
fs/fuse/file.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 28e6b3c1aa066..5722cd4414318 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -252,6 +252,11 @@ static void fuse_link_rw_file(struct file *file)
struct fuse_file *ff = file->private_data;
spin_lock(&fi->lock);
+ if (test_bit(FUSE_I_INVAL_FILES, &fi->state)) {
+ spin_lock(&ff->lock);
+ set_bit(FUSE_S_FAIL_IMMEDIATELY, &ff->ff_state);
+ spin_unlock(&ff->lock);
+ }
if (list_empty(&ff->rw_entry))
list_add(&ff->rw_entry, &fi->rw_files);
spin_unlock(&fi->lock);
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel