Skip to content

Commit 282ea03

Browse files
Andreas Gruenbachervijay-suman
authored andcommitted
writeback: fix false warning in inode_to_wb()
commit 9e888998ea4d22257b07ce911576509486fa0667 upstream. 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/[email protected] Fixes: aaa2cac ("writeback: add lockdep annotation to inode_to_wb()") Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Reviewed-by: Andreas Gruenbacher <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 2b109b99d45f1c97b2025fefa6dbf5c7f37390f9) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 0d998cf commit 282ea03

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
@@ -283,6 +283,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
283283
{
284284
#ifdef CONFIG_LOCKDEP
285285
WARN_ON_ONCE(debug_locks &&
286+
(inode->i_sb->s_iflags & SB_I_CGROUPWB) &&
286287
(!lockdep_is_held(&inode->i_lock) &&
287288
!lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
288289
!lockdep_is_held(&inode->i_wb->list_lock)));

0 commit comments

Comments
 (0)