It should only reset and revise file mapping for the valid cached
file (@cached == true) in pcc_file_mapping_reset().
Otherwise, it will cause sanity-pcc test_97 panic as follows:
(pcc.c:3077:pcc_vma_file_reset())
ASSERTION( vma->vm_file->f_mapping == inode->i_mapping ) failed:
panic+0x114/0x2f6
lbug_with_loc.cold+0x30/0x69 [libcfs]
pcc_mmap_io_init+0xafe/0xd60 [lustre]
pcc_fault+0x170/0x3d0 [lustre]
ll_fault+0x43/0x9a0 [lustre]
__do_fault+0x3c/0x170
do_fault+0x24b/0x640
Test-Parameters: testlist=sanity-pcc env=ONLY=97,ONLY_REPEAT=50
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I7e9cd0cba9d230160c90a32bef452139c23164b3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57999
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
pcc_file_fallback_set(ll_i2info(inode), pccf);
}
- if (pcc_file) {
+ if (pcc_file && cached) {
struct inode *pcc_inode = file_inode(pcc_file);
if (pcc_inode->i_mapping == &pcc_inode->i_data)