Whamcloud - gitweb
EX-5358 pcc: remove realpath() from lfs_pcc_state()
Before Ubuntu 20.04, realpath() executes lstat() for each
component of the path. If the file is still valid cached on PCC
device with the layout generation unchanged, the Lustre file will
be auto re-attach during the stat() call in the Lustre kernel.
This may result in misunderstanding for the operation "lfs pcc
state" on a file that has already detached but still valid cached
on PCC according to the unchanged layout generation.
This problem exposes on the newer Ubuntu 22.04 in which realpath()
executes readlink() for each component of the path instead of
lstat():
readlink("/mnt", 0x7fffd5760800, 1023) = -1
readlink("/mnt/lustre", 0x7fffd5760800, 1023) = -1
readlink("/mnt/lustre/sanity-pcc.f15", 0x7fffd5760800, 1023) = -1
In this patch, it remove realpath() from lfs_pcc_state() to avoid
this misunderstanding behavior for the command: $LFS pcc state.
And it also fixes the test scripts sanity-pcc: test_15, test_16,
test_27, test_39.
Change-Id: I50ae46a1e952a3faaf0d7a7293579e239156d6d3
Test-Parameters: clientdistro=el8.5 env=SANITY_PCC_EXCEPT="101a" testlist=sanity-pcc
Test-Parameters: clientdistro=ubuntu2204 env=SANITY_PCC_EXCEPT="101a 39" testlist=sanity-pcc
Test-Parameters: clientdistro=ubuntu2004 env=SANITY_PCC_EXCEPT="101a" testlist=sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/47632
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>