From: Jan Kara Date: Thu, 26 Mar 2026 09:53:55 +0000 (+0100) Subject: ext4: Use inode_has_buffers() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab856368582b9b97b35e1a98e5bf3b0b300a583d;p=thirdparty%2Flinux.git ext4: Use inode_has_buffers() Instead of checking i_private_list directly use appropriate wrapper inode_has_buffers(). Also delete stale comment. Acked-by: Theodore Ts'o Signed-off-by: Jan Kara Link: https://patch.msgid.link/20260326095354.16340-43-jack@suse.cz Tested-by: syzbot@syzkaller.appspotmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/buffer.c b/fs/buffer.c index 22b43642ba574..1bc0f22f3cc25 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -524,6 +524,7 @@ int inode_has_buffers(struct inode *inode) { return !list_empty(&inode->i_data.i_private_list); } +EXPORT_SYMBOL_GPL(inode_has_buffers); /* * osync is designed to support O_SYNC io. It waits synchronously for diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 396dc3a5d16b4..d18d94acddcc1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1420,9 +1420,6 @@ static int write_end_fn(handle_t *handle, struct inode *inode, /* * We need to pick up the new inode size which generic_commit_write gave us * `iocb` can be NULL - eg, when called from page_symlink(). - * - * ext4 never places buffers on inode->i_mapping->i_private_list. metadata - * buffers are managed internally. */ static int ext4_write_end(const struct kiocb *iocb, struct address_space *mapping, @@ -3437,7 +3434,7 @@ static bool ext4_inode_datasync_dirty(struct inode *inode) } /* Any metadata buffers to write? */ - if (!list_empty(&inode->i_mapping->i_private_list)) + if (inode_has_buffers(inode)) return true; return inode_state_read_once(inode) & I_DIRTY_DATASYNC; }