From 85b743b3bfbedc90efe221183063f2ae48bc11df Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Mon, 6 Sep 2021 15:51:55 +0800 Subject: [PATCH] EX-3752 pcc: show attaching state for PCC state output When set llite.*.pcc_async_threshold=0, the client will do PCC attach in asynchronous way. When the file is large, attaching the file into PCC may take some time. In this patch, we improve that output of the PCC command "lfs pcc state" to show that the file is in PCC attaching state when the file is still in the phase of copying from Lustre OSTs to PCC. Signed-off-by: Qian Yingjin Change-Id: I101d87638f5afac41fb4f55b4aaf95d938bc8ccd Reviewed-on: https://review.whamcloud.com/44852 Tested-by: jenkins Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/llite/pcc.c | 4 +++- lustre/utils/lfs.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index 3654dfd..c6cda30 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -4027,6 +4027,7 @@ int pcc_ioctl_state(struct file *file, struct inode *inode, char *buf; char *path; int buf_len = sizeof(state->pccs_path); + struct ll_inode_info *lli = ll_i2info(inode); struct pcc_inode *pcci; ENTRY; @@ -4042,6 +4043,7 @@ int pcc_ioctl_state(struct file *file, struct inode *inode, pcci = ll_i2pcci(inode); if (pcci == NULL) { state->pccs_type = LU_PCC_NONE; + state->pccs_flags = lli->lli_pcc_state; GOTO(out_unlock, rc = 0); } @@ -4065,7 +4067,7 @@ int pcc_ioctl_state(struct file *file, struct inode *inode, state->pccs_type = pcci->pcci_type; state->pccs_open_count = count; - state->pccs_flags = ll_i2info(inode)->lli_pcc_state; + state->pccs_flags = lli->lli_pcc_state; path = dentry_path_raw(pcci->pcci_path.dentry, buf, buf_len); if (IS_ERR(path)) GOTO(out_unlock, rc = PTR_ERR(path)); diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index bbb13c3..8bbebd5 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -11853,6 +11853,8 @@ static int lfs_pcc_state(int argc, char **argv) printf(", type: %s", pcc_type2string(state.pccs_type)); if (state.pccs_type == LU_PCC_NONE && state.pccs_open_count == 0) { + if (state.pccs_flags & PCC_STATE_FL_ATTACHING) + printf(", flags: attaching"); printf("\n"); continue; } -- 1.8.3.1