Skip to content

Commit 9e88899

Browse files
Andreas Gruenbacherakpm00
authored andcommitted
writeback: fix false warning in inode_to_wb()
inode_to_wb() is used also for filesystems that don't support cgroup writeback. For these filesystems inode->i_wb is stable during the lifetime of the inode (it points to bdi->wb) and there's no need to hold locks protecting the inode->i_wb dereference. Improve the warning in inode_to_wb() to not trigger for these filesystems. Link: https://lkml.kernel.org/r/20250412163914.3773459-3-agruenba@redhat.com Fixes: aaa2cac ("writeback: add lockdep annotation to inode_to_wb()") Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent fd0ad5e commit 9e88899

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/backing-dev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
249249
{
250250
#ifdef CONFIG_LOCKDEP
251251
WARN_ON_ONCE(debug_locks &&
252+
(inode->i_sb->s_iflags & SB_I_CGROUPWB) &&
252253
(!lockdep_is_held(&inode->i_lock) &&
253254
!lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
254255
!lockdep_is_held(&inode->i_wb->list_lock)));

0 commit comments

Comments
 (0)