[Devel] [PATCH vz10 v3 06/11] ext4: remove inode_lock from ext4_sync_files

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 22 22:14:12 MSK 2025


From: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

Remove inode_lock_shared() and inode_unlock_shared() calls as they are
not needed for accessing inode information in this context.

Similar to upstream commit:
92e6222dfb85 ("ext4: remove i_mutex from ext4_file_sync()")

Part of rework for ext4_sync_files function.

Fixes: 26337aacaafa9 ("ext4: add mfsync support")
https://virtuozzo.atlassian.net/browse/VSTOR-107255
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

Feature: ext4: optimized sync of a set of files - mfsync()
---
 fs/ext4/fsync.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 88353471cd733..592f564c146c4 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -239,10 +239,8 @@ int ext4_sync_files(struct file **files, unsigned int *flags, unsigned int nr_fi
 				err = err2;
 		}
 
-		inode_lock_shared(inode);
 		force_commit  |= ext4_should_journal_data(inode);
 		tid = datasync ? ei->i_datasync_tid : ei->i_sync_tid;
-		inode_unlock_shared(inode);
 		trace_ext4_sync_files_iterate(files[j]->f_path.dentry, tid, datasync);
 		if (j == 0 || !tid_geq(commit_tid, tid))
 			commit_tid = tid;
-- 
2.43.0



More information about the Devel mailing list