struct inode *inode = &pcci->pcci_lli->lli_vfs_inode;
struct inode *pcc_inode = pcci->pcci_path.dentry->d_inode;
- if (inode && IS_ENCRYPTED(inode) && pcc_inode)
- /* get rid of all page cache pages for this inode,
+ if (inode && IS_ENCRYPTED(inode) && pcc_inode) {
+ /* get rid of all page cache pages for this pcc inode,
* as they contain clear text data
*/
truncate_inode_pages_final(pcc_inode->i_mapping);
+ /* also get rid of pages cache pages for this Lustre
+ * inode, as they might contain cipher text because
+ * of the pcc file
+ */
+ truncate_inode_pages_final(inode->i_mapping);
+ }
pcc_inode_fini(pcci);
}
do_facet $SINGLEAGT cmp -bl -n 4096 $tmpfile $lpcc_path ||
error "file $lpcc_path is corrupted (5)"
+ do_facet $SINGLEAGT cp $tmpfile ${file}_2
+ do_facet $SINGLEAGT $LFS getstripe ${file}_2
+ do_facet $SINGLEAGT $LFS pcc attach -r -i $HSM_ARCHIVE_NUMBER ${file}_2 ||
+ error "failed to PCC-RO attach file ${file}_2"
+ check_lpcc_state ${file}_2 "readonly"
+ echo "PCC-RO attach '${file}_2':"
+ do_facet $SINGLEAGT $LFS getstripe -v ${file}_2
+
+ do_facet $SINGLEAGT $LFS pcc detach ${file}_2 ||
+ error "failed to PCC-RO detach file ${file}_2"
+ do_facet $SINGLEAGT cmp -bl $tmpfile ${file}_2 ||
+ error "file ${file}_2 is corrupted (6)"
+ rm -f ${file}_2
+
# remove fscrypt key from keyring
key=$(do_facet $SINGLEAGT keyctl show |
awk '$7 ~ "^fscrypt:" {print $1}')