From: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> Move journal availability check earlier in the function, right after obtaining the journal pointer. This allows for early exit when no journal is available, improving code flow and readability.
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 <ptikhomi...@virtuozzo.com> Feature: ext4: optimized sync of a set of files - mfsync() --- fs/ext4/fsync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index f31086efb7977..9905b2363908f 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -196,6 +196,8 @@ int ext4_sync_files(struct file **files, unsigned int *flags, unsigned int nr_fi J_ASSERT(ext4_journal_current_handle() == NULL); journal = EXT4_SB(sb)->s_journal; + if (!journal) + return -ENOTSUPP; if (sb_rdonly(sb)) { return 0; } @@ -247,9 +249,7 @@ int ext4_sync_files(struct file **files, unsigned int *flags, unsigned int nr_fi } /* Ext4 specific stuff starts here */ - if (!journal) { - return -ENOTSUPP; - } else if (force_commit) { + if (force_commit) { /* data=journal: * filemap_fdatawrite won't do anything (the buffers are clean). * ext4_force_commit will write the file data into the journal and -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel