From 0cc1756e9fb28609705f5f86b8e2197f57b40513 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Tue, 23 Feb 2016 10:45:21 -0600 Subject: [PATCH] LU-8820 hsm: skip LL_IOC_HSM_COPY_START for HSM removes In llapi_hsm_action_begin(), if the action is a remove then skip calling the LL_IOC_HSM_COPY_START ioctl. Signed-off-by: John L. Hammond Change-Id: Id84f1877a4f05c91e063797b51bd2046f2283ec4 Reviewed-on: https://review.whamcloud.com/23700 Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- lustre/utils/liblustreapi_hsm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c index 345ab1b..8fe05b4 100644 --- a/lustre/utils/liblustreapi_hsm.c +++ b/lustre/utils/liblustreapi_hsm.c @@ -1126,12 +1126,18 @@ int llapi_hsm_action_begin(struct hsm_copyaction_private **phcp, goto err_out; } + /* Since remove is atomic there is no need to send an initial + * MDS_HSM_PROGRESS RPC. */ + if (hai->hai_action == HSMA_REMOVE) + goto out_log; + rc = ioctl(ct->mnt_fd, LL_IOC_HSM_COPY_START, &hcp->copy); if (rc < 0) { rc = -errno; goto err_out; } +out_log: llapi_hsm_log_ct_progress(&hcp, hai, CT_START, 0, 0); ok_out: -- 1.8.3.1