goto fini;
}
+ /* When restore request for a file triggered by read/write/
+ * truncate operation from another client, it needs to detach
+ * the file first if it is PCC-attached.
+ */
+ rc = llapi_pcc_detach_fid_fd(opt.o_mnt_fd, &hai->hai_fid);
+ if (rc) {
+ CT_ERROR(rc, "cannot detach pcc for file '%s'", dst);
+ goto fini;
+ }
+
dst_fd = llapi_hsm_action_get_fd(hcp);
if (dst_fd < 0) {
rc = dst_fd;