Whamcloud - gitweb
LU-18743 llite: inode_to_wb() needs locking 61/58161/3
authorJames Simmons <jsimmons@infradead.org>
Sat, 22 Feb 2025 15:10:24 +0000 (10:10 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:05:12 +0000 (08:05 +0000)
commit5fb5cccd934acba8fdeb0eeb75004fb727875240
treea7c38508755cc952008a9ff35d78bfea4976b694
parent103c1f560c8c8dde601aac1fafed137b19fa3429
LU-18743 llite: inode_to_wb() needs locking

When running a kernel with lockdep turned on testing shows the
following error:

WARNING: CPU: 1 PID: 37 at include/linux/backing-dev.h:291 ll_writepages+0x3dd/0x400 [lustre]
Workqueue: writeback wb_workfn (flush-lustre-ffff8f09f4)
RIP: 0010:ll_writepages+0x3dd/0x400 [lustre]
Call Trace: [ 1267.032775] ? show_regs.cold.9+0x22/0x2f
 ? __warn+0xc8/0x150 [ 1267.043623] ? ll_writepages+0x3dd/0x400 [lustre]

This due to inode_to_wb() being called without a lock. We can
pick from 3 types of locks but I went with the inode i_lock.

Change-Id: I7427041d6df102161c06cfbb05b7e26428675225
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58161
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/rw.c