Whamcloud - gitweb
LU-18705 pcc: only reset file mapping for valid cached file 99/57999/3
authorQian Yingjin <qian@ddn.com>
Thu, 6 Feb 2025 12:41:59 +0000 (20:41 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Mar 2025 08:06:25 +0000 (08:06 +0000)
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>
lustre/llite/pcc.c

index ac88db9..a07315d 100644 (file)
@@ -2282,7 +2282,7 @@ pcc_file_mapping_reset(struct inode *inode, struct file *file, bool cached)
                        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)