Whamcloud - gitweb
LU-12373 pcc: delete stale PCC copy when remove PCC backend
authorQian Yingjin <qian@ddn.com>
Thu, 22 Oct 2020 08:22:45 +0000 (16:22 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 25 Mar 2021 14:16:48 +0000 (14:16 +0000)
commit7b94fc09f6415f45b44a33af51e9dd7cb87d0060
tree3c14168004a775e8709aa3c0469fc3b7e66b60fe
parentbf96c972e6dfb1266b2c4c385cb2f11b1d9edd4e
LU-12373 pcc: delete stale PCC copy when remove PCC backend

By defualt, when removing a PCC backend from a client, the action
is to scan the PCC backend FS, uncache (detach and remove) all
scanned PCC copies from PCC by FIDs.

However, during the tests, we found that some old stale PCC copies
are not removed when an adminstrator runs "lctl pcc del|clear".
The reason is that these PCC copies are already detached from PCC
when running the commands.

This patch fixes this bug: when removing a PCC backend from a
client, it will also delete all non-cached PCC copies from PCC
backend to free up the space.

Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Id829abe7e6cb1294e6baea76452f4a9178711451
Reviewed-on: https://review.whamcloud.com/41925
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/pcc.c
lustre/llite/pcc.h
lustre/tests/sanity-pcc.sh
lustre/utils/liblustreapi_pcc.c