Skip to content

Commit e360c6e

Browse files
jankaratytso
authored andcommitted
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>
1 parent 1f1a55f commit e360c6e

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

fs/ext4/fsync.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,12 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
153153
goto out;
154154

155155
/*
156-
* data=writeback,ordered:
157156
* The caller's filemap_fdatawrite()/wait will sync the data.
158157
* Metadata is in the journal, we wait for proper transaction to
159158
* 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.
168159
*/
169160
if (!sbi->s_journal)
170161
ret = ext4_fsync_nojournal(inode, datasync, &needs_barrier);
171-
else if (ext4_should_journal_data(inode))
172-
ret = ext4_force_commit(inode->i_sb);
173162
else
174163
ret = ext4_fsync_journal(inode, datasync, &needs_barrier);
175164

0 commit comments

Comments
 (0)