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>
* The system is under memory pressure and it is now reclaiming
* cache pages.
*/
+ spin_lock(&inode->i_lock);
wb = inode_to_wb(inode);
if (wbc->for_background ||
(wb->start_all_reason == WB_REASON_VMSCAN &&
test_bit(WB_start_all, &wb->state)))
mode = CL_FSYNC_RECLAIM;
+ spin_unlock(&inode->i_lock);
#else
/*
* We have no idea about writeback reason for memory reclaim