From: Qian Yingjin Date: Mon, 29 Apr 2024 02:49:57 +0000 (-0400) Subject: LU-17789 pcc: dont auto PCCRO attach for write/setattr X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=fc0b0e3390aa16e8e5470ceb968b340128996e95;p=fs%2Flustre-release.git LU-17789 pcc: dont auto PCCRO attach for write/setattr It is meaningless for a client to do auto PCCRO attach for write and setattr operations. Moreover, it may result in sanity-pcc/test_21d failure as follows: "FAIL: expected /mnt/lustre/f21d.sanity-pcc: write_mod_data, got: write_mod_dataa" This patch fixed it by disabling PCCRO auto attach for write and setattr operations. Change-Id: I894db1953a119d12e9337251c069c594fb40482a Test-Parameters: testlist=sanity-pcc env=ONLY=21d,ONLY_REPEAT=10 Signed-off-by: Qian Yingjin Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54946 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index cb0e390..3cf2443 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -2169,12 +2169,17 @@ static int pcc_try_auto_attach(struct inode *inode, bool *cached, RETURN(-EINVAL); } - if (clt.cl_is_released) + if (clt.cl_is_released) { rc = pcc_try_datasets_attach(inode, iot, clt.cl_layout_gen, LU_PCC_READWRITE, cached); - else if (clt.cl_is_rdonly) + } else if (clt.cl_is_rdonly) { + /* Not try read-only attach for data modification operations */ + if (iot == PIT_WRITE || iot == PIT_SETATTR) + RETURN(0); + rc = pcc_try_datasets_attach(inode, iot, clt.cl_layout_gen, LU_PCC_READONLY, cached); + } if (*cached && iot != PIT_VALID_CHECK) ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_PCC_AUTOAT, 1);