Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: Drop special handling of journalled data from ext4_sync_file()

Now that ext4_writepages() make sure all pages with journalled data are
stable on disk, we don't need special handling of journalled data in
ext4_sync_file().

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230329154950.19720-6-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Jan Kara and committed by
Theodore Ts'o
e360c6ed 1f1a55f0

-11
-11
fs/ext4/fsync.c
··· 153 153 goto out; 154 154 155 155 /* 156 - * data=writeback,ordered: 157 156 * The caller's filemap_fdatawrite()/wait will sync the data. 158 157 * Metadata is in the journal, we wait for proper transaction to 159 158 * commit here. 160 - * 161 - * data=journal: 162 - * filemap_fdatawrite won't do anything (the buffers are clean). 163 - * ext4_force_commit will write the file data into the journal and 164 - * will wait on that. 165 - * filemap_fdatawait() will encounter a ton of newly-dirtied pages 166 - * (they were dirtied by commit). But that's OK - the blocks are 167 - * safe in-journal, which is all fsync() needs to ensure. 168 159 */ 169 160 if (!sbi->s_journal) 170 161 ret = ext4_fsync_nojournal(inode, datasync, &needs_barrier); 171 - else if (ext4_should_journal_data(inode)) 172 - ret = ext4_force_commit(inode->i_sb); 173 162 else 174 163 ret = ext4_fsync_journal(inode, datasync, &needs_barrier); 175 164