From cd02cb1d66d5d37e6600ce5a7d7188e3db9ae9f6 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 6 Oct 2021 02:19:10 -0600 Subject: [PATCH] EX-3825 pcc: no error to detach missing file Do not print an error message if "lfs pcc detach" tries to detach a file that is already removed from the cache. This might happen for a wide variety of reasons (external cache cleanup process, etc). Test-Parameters: trivial testlist=sanity-pcc Signed-off-by: Andreas Dilger Change-Id: Iad07b4bbab809bd356ed06c9f5cfcc35fa3ebbe5 Reviewed-on: https://review.whamcloud.com/45132 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Feng, Lei Reviewed-by: Yingjin Qian --- lustre/llite/pcc.c | 4 ++-- lustre/utils/lfs.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index 44edbb3..62e1cb6 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -3137,8 +3137,8 @@ static int pcc_inode_remove(struct inode *inode, struct dentry *pcc_dentry) int rc; rc = ll_vfs_unlink(pcc_dentry->d_parent->d_inode, pcc_dentry); - if (rc) - CWARN("%s: failed to unlink PCC file %pd, rc = %d\n", + if (rc && rc != -ENOENT) + CWARN("%s: failed to unlink PCC file %pd: rc = %d\n", ll_i2sbi(inode)->ll_fsname, pcc_dentry, rc); return rc; diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 9bab865..e372de5 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -11842,10 +11842,9 @@ static int lfs_pcc_detach(int argc, char **argv) } rc2 = llapi_pcc_detach_file(fullpath, detach_flags); - if (rc2 < 0) { + if (rc2 < 0 && rc2 != -ENOENT) { rc2 = -errno; - fprintf(stderr, - "%s: cannot detach '%s' from PCC: %s\n", + fprintf(stderr, "%s: cannot detach '%s' from PCC: %s\n", argv[0], path, strerror(errno)); if (rc == 0) rc = rc2; -- 1.8.3.1