@@ -1616,6 +1616,13 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
clear_bit(LLIF_DATA_MODIFIED, &lli->lli_flags);
}
+ if (attr->ia_valid & ATTR_FILE) {
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(attr->ia_file);
+
+ if (fd->fd_lease_och)
+ op_data->op_bias |= MDS_TRUNC_KEEP_LEASE;
+ }
+
op_data->op_attr = *attr;
op_data->op_xvalid = xvalid;
@@ -1700,6 +1700,7 @@ enum mds_op_bias {
MDS_CLOSE_LAYOUT_MERGE = 1 << 15,
MDS_CLOSE_RESYNC_DONE = 1 << 16,
MDS_CLOSE_LAYOUT_SPLIT = 1 << 17,
+ MDS_TRUNC_KEEP_LEASE = 1 << 18,
};
#define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP | \