Whamcloud - gitweb
EX-3752 pcc: show attaching state for PCC state output
authorQian Yingjin <qian@ddn.com>
Mon, 6 Sep 2021 07:51:55 +0000 (15:51 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 8 Sep 2021 17:48:32 +0000 (17:48 +0000)
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 <qian@ddn.com>
Change-Id: I101d87638f5afac41fb4f55b4aaf95d938bc8ccd
Reviewed-on: https://review.whamcloud.com/44852
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/pcc.c
lustre/utils/lfs.c

index 3654dfd..c6cda30 100644 (file)
@@ -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));
index bbb13c3..8bbebd5 100644 (file)
@@ -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;
                }