@@ -1745,6 +1745,7 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild,
struct ll_sb_info *sbi = ll_i2sbi(src);
struct md_op_data *op_data;
ktime_t kstart = ktime_get();
+ umode_t mode = 0;
int err;
if (flags)
@@ -1762,7 +1763,13 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild,
if (err)
return err;
- op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0,
+ if (src_dchild->d_inode)
+ mode = src_dchild->d_inode->i_mode;
+
+ if (tgt_dchild->d_inode)
+ mode = tgt_dchild->d_inode->i_mode;
+
+ op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, mode,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
return PTR_ERR(op_data);