[Devel] [PATCH RHEL9 COMMIT] fs: fuse: rwwr deadlock in fallocate

Konstantin Khorenko khorenko at virtuozzo.com
Fri Nov 15 17:56:15 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-427.37.1.vz9.78.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.37.1.vz9.78.4
------>
commit 96fe95db737e0b44cd31b66d1b2f7f8c0a0c5efc
Author: Alexey Kuznetsov <kuznet at virtuozzo.com>
Date:   Fri Nov 15 22:13:34 2024 +0800

    fs: fuse: rwwr deadlock in fallocate
    
    One thread has made fallocate and needs to take inode_lock()
    to commit attributes _before_ it dropped dio write iocount.
    Another thread took inode_mutex and has to wait for pending
    writes since it hit fuse cached writeback region.
    
    Affects: #VSTOR-95025
    https://virtuozzo.atlassian.net/browse/VSTOR-95025
    Fixes: ead9b9aec946 ("fs: fuse: kio: resolve race condition fallocate vs
    shrink")
    
    Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
    
    Feature: vStorage
---
 fs/fuse/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index aa248bd90694..6a89f9642325 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3469,8 +3469,8 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
 	args.in_args[0].value = &inarg;
 	err = fuse_simple_request(fm, &args);
 	if (revoke_lock) {
-		inode_lock(inode);
 		fuse_write_dio_end(fi);
+		inode_lock(inode);
 	}
 	if (err == -ENOSYS) {
 		fm->fc->no_fallocate = 1;


More information about the Devel mailing list