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

Configure Feed

Select the types of activity you want to include in your feed.

fs: Drop sync_mapping_buffers() from __generic_file_fsync()

No filesystem calling __generic_file_fsync() uses metadata bh tracking.
Drop sync_mapping_buffers() call from __generic_file_fsync() as it's
pointless now which untangles buffer head handling from fs/libfs.c.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260326095354.16340-55-jack@suse.cz
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jan Kara and committed by
Christian Brauner
aec4fe7c 635aa2f6

+2 -7
+2 -7
fs/libfs.c
··· 18 18 #include <linux/exportfs.h> 19 19 #include <linux/iversion.h> 20 20 #include <linux/writeback.h> 21 - #include <linux/buffer_head.h> /* sync_mapping_buffers */ 22 21 #include <linux/fs_context.h> 23 22 #include <linux/pseudo_fs.h> 24 23 #include <linux/fsnotify.h> ··· 1554 1555 { 1555 1556 struct inode *inode = file->f_mapping->host; 1556 1557 int err; 1557 - int ret; 1558 + int ret = 0; 1558 1559 1559 1560 err = file_write_and_wait_range(file, start, end); 1560 1561 if (err) 1561 1562 return err; 1562 1563 1563 - ret = sync_mapping_buffers(inode->i_mapping); 1564 1564 if (!(inode_state_read_once(inode) & I_DIRTY_ALL)) 1565 1565 goto out; 1566 1566 if (datasync && !(inode_state_read_once(inode) & I_DIRTY_DATASYNC)) 1567 1567 goto out; 1568 1568 1569 - err = sync_inode_metadata(inode, 1); 1570 - if (ret == 0) 1571 - ret = err; 1572 - 1569 + ret = sync_inode_metadata(inode, 1); 1573 1570 out: 1574 1571 /* check and advance again to catch errors after syncing out buffers */ 1575 1572 err = file_check_and_advance_wb_err(file);