X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fnamei.c;h=9b7241a89cfa1886aacefcd1050cc473eadd2c10;hb=a71586d4ee8d6f039a413e2a0fd791db847a3c19;hp=92a99c4e9a1d69d159641badc38d9a5a82b8e369;hpb=3108bbb0b8485484bc1ac8ba5bac4276fc11c7c3;p=fs%2Flustre-release.git diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 92a99c4..9b7241a 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -49,7 +49,8 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, struct lookup_intent *it, - void *secctx, __u32 secctxlen); + void *secctx, __u32 secctxlen, bool encrypt, + void *encctx, __u32 encctxlen); /* called from iget5_locked->find_inode() under inode_lock spinlock */ static int ll_test_inode(struct inode *inode, void *opaque) @@ -611,7 +612,8 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, struct lookup_intent *it, struct inode *parent, struct dentry **de, void *secctx, __u32 secctxlen, - ktime_t kstart) + void *encctx, __u32 encctxlen, + ktime_t kstart, bool encrypt) { struct inode *inode = NULL; __u64 bits = 0; @@ -632,6 +634,36 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, if (rc) RETURN(rc); + /* If encryption context was returned by MDT, put it in + * inode now to save an extra getxattr and avoid deadlock. + */ + if (body->mbo_valid & OBD_MD_ENCCTX) { + encctx = req_capsule_server_get(pill, &RMF_FILE_ENCCTX); + encctxlen = req_capsule_get_size(pill, + &RMF_FILE_ENCCTX, + RCL_SERVER); + + if (encctxlen) { + CDEBUG(D_SEC, + "server returned encryption ctx for "DFID"\n", + PFID(ll_inode2fid(inode))); + rc = ll_xattr_cache_insert(inode, + LL_XATTR_NAME_ENCRYPTION_CONTEXT, + encctx, encctxlen); + if (rc) + CWARN("%s: cannot set enc ctx for "DFID": rc = %d\n", + ll_i2sbi(inode)->ll_fsname, + PFID(ll_inode2fid(inode)), rc); + else if (encrypt) { + rc = llcrypt_get_encryption_info(inode); + if (rc) + CDEBUG(D_SEC, + "cannot get enc info for "DFID": rc = %d\n", + PFID(ll_inode2fid(inode)), rc); + } + } + } + if (it->it_op & IT_OPEN) ll_dom_finish_open(inode, request, it); @@ -664,14 +696,17 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, } if (secctx != NULL && secctxlen != 0) { - inode_lock(inode); + /* no need to protect selinux_inode_setsecurity() by + * inode_lock. Taking it would lead to a client deadlock + * LU-13617 + */ rc = security_inode_notifysecctx(inode, secctx, secctxlen); - inode_unlock(inode); if (rc) - CWARN("cannot set security context for " - DFID": rc = %d\n", - PFID(ll_inode2fid(inode)), rc); + CWARN("%s: cannot set security context for "DFID": rc = %d\n", + ll_i2sbi(inode)->ll_fsname, + PFID(ll_inode2fid(inode)), + rc); } } @@ -688,6 +723,14 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, /* we have lookup look - unhide dentry */ if (bits & MDS_INODELOCK_LOOKUP) d_lustre_revalidate(*de); + + if (encrypt) { + rc = llcrypt_get_encryption_info(inode); + if (rc) + GOTO(out, rc); + if (!llcrypt_has_encryption_key(inode)) + GOTO(out, rc = -ENOKEY); + } } else if (!it_disposition(it, DISP_OPEN_CREATE)) { /* * If file was created on the server, the dentry is revalidated @@ -735,7 +778,9 @@ out: static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, struct lookup_intent *it, void **secctx, __u32 *secctxlen, - struct pcc_create_attach *pca) + struct pcc_create_attach *pca, + bool encrypt, + void **encctx, __u32 *encctxlen) { ktime_t kstart = ktime_get(); struct lookup_intent lookup_it = { .it_op = IT_LOOKUP }; @@ -749,21 +794,20 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, ENTRY; - if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen) - RETURN(ERR_PTR(-ENAMETOOLONG)); + if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen) + RETURN(ERR_PTR(-ENAMETOOLONG)); - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p), intent=%s\n", - dentry->d_name.len, dentry->d_name.name, - PFID(ll_inode2fid(parent)), parent, LL_IT2STR(it)); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), intent=%s\n", + dentry, PFID(ll_inode2fid(parent)), parent, LL_IT2STR(it)); - if (d_mountpoint(dentry)) - CERROR("Tell Peter, lookup on mtpt, it %s\n", LL_IT2STR(it)); + if (d_mountpoint(dentry)) + CERROR("Tell Peter, lookup on mtpt, it %s\n", LL_IT2STR(it)); if (it == NULL || it->it_op == IT_GETXATTR) it = &lookup_it; if (it->it_op == IT_GETATTR && dentry_may_statahead(parent, dentry)) { - rc = ll_statahead(parent, &dentry, 0); + rc = ll_revalidate_statahead(parent, &dentry, 0); if (rc == 1) RETURN(dentry == save ? NULL : dentry); } @@ -805,6 +849,20 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, if (secctxlen != NULL) *secctxlen = 0; } + if (it->it_op & IT_CREAT && encrypt) { + rc = llcrypt_inherit_context(parent, NULL, op_data, false); + if (rc) + GOTO(out, retval = ERR_PTR(rc)); + if (encctx != NULL) + *encctx = op_data->op_file_encctx; + if (encctxlen != NULL) + *encctxlen = op_data->op_file_encctx_size; + } else { + if (encctx != NULL) + *encctx = NULL; + if (encctxlen != NULL) + *encctxlen = 0; + } /* ask for security context upon intent */ if (it->it_op & (IT_LOOKUP | IT_GETATTR | IT_OPEN)) { @@ -885,18 +943,20 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, rc = ll_lookup_it_finish(req, it, parent, &dentry, secctx != NULL ? *secctx : NULL, secctxlen != NULL ? *secctxlen : 0, - kstart); - if (rc != 0) { - ll_intent_release(it); - GOTO(out, retval = ERR_PTR(rc)); - } - - if ((it->it_op & IT_OPEN) && dentry->d_inode && - !S_ISREG(dentry->d_inode->i_mode) && - !S_ISDIR(dentry->d_inode->i_mode)) { - ll_release_openhandle(dentry, it); - } - ll_lookup_finish_locks(it, dentry); + encctx != NULL ? *encctx : NULL, + encctxlen != NULL ? *encctxlen : 0, + kstart, encrypt); + if (rc != 0) { + ll_intent_release(it); + GOTO(out, retval = ERR_PTR(rc)); + } + + if ((it->it_op & IT_OPEN) && dentry->d_inode && + !S_ISREG(dentry->d_inode->i_mode) && + !S_ISDIR(dentry->d_inode->i_mode)) { + ll_release_openhandle(dentry, it); + } + ll_lookup_finish_locks(it, dentry); GOTO(out, retval = (dentry == save) ? NULL : dentry); @@ -908,6 +968,14 @@ out: op_data->op_file_secctx = NULL; op_data->op_file_secctx_size = 0; } + if (encctx != NULL && encctxlen != NULL && + it->it_op & IT_CREAT && encrypt) { + /* caller needs enc ctx info, so reset it in op_data to + * prevent it from being freed + */ + op_data->op_file_encctx = NULL; + op_data->op_file_encctx_size = 0; + } ll_finish_md_op_data(op_data); } @@ -924,9 +992,8 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry, struct lookup_intent *itp, it = { .it_op = IT_GETATTR }; struct dentry *de; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p), flags=%u\n", - dentry->d_name.len, dentry->d_name.name, - PFID(ll_inode2fid(parent)), parent, flags); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), flags=%u\n", + dentry, PFID(ll_inode2fid(parent)), parent, flags); /* * Optimize away (CREATE && !OPEN). Let .create handle the race. @@ -941,7 +1008,8 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry, itp = NULL; else itp = ⁢ - de = ll_lookup_it(parent, dentry, itp, NULL, NULL, NULL); + de = ll_lookup_it(parent, dentry, itp, NULL, NULL, NULL, false, + NULL, NULL); if (itp != NULL) ll_intent_release(itp); @@ -982,15 +1050,17 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, long long lookup_flags = LOOKUP_OPEN; void *secctx = NULL; __u32 secctxlen = 0; - struct ll_sb_info *sbi; + void *encctx = NULL; + __u32 encctxlen = 0; + struct ll_sb_info *sbi = NULL; struct pcc_create_attach pca = { NULL, NULL }; + bool encrypt = false; int rc = 0; ENTRY; CDEBUG(D_VFSTRACE, - "VFS Op:name=%.*s, dir="DFID"(%p), file %p, open_flags %x, mode %x opened %d\n", - dentry->d_name.len, dentry->d_name.name, - PFID(ll_inode2fid(dir)), dir, file, open_flags, mode, + "VFS Op:name=%pd, dir="DFID"(%p), file %p, open_flags %x, mode %x opened %d\n", + dentry, PFID(ll_inode2fid(dir)), dir, file, open_flags, mode, ll_is_opened(opened, file)); /* Only negative dentries enter here */ @@ -1039,8 +1109,22 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, it->it_flags = (open_flags & ~O_ACCMODE) | OPEN_FMODE(open_flags); it->it_flags &= ~MDS_OPEN_FL_INTERNAL; + if (ll_sbi_has_encrypt(ll_i2sbi(dir)) && IS_ENCRYPTED(dir)) { + /* we know that we are going to create a regular file because + * we set S_IFREG bit on it->it_create_mode above + */ + rc = llcrypt_get_encryption_info(dir); + if (rc) + GOTO(out_release, rc); + if (!llcrypt_has_encryption_key(dir)) + GOTO(out_release, rc = -ENOKEY); + encrypt = true; + rc = 0; + } + /* Dentry added to dcache tree in ll_lookup_it */ - de = ll_lookup_it(dir, dentry, it, &secctx, &secctxlen, &pca); + de = ll_lookup_it(dir, dentry, it, &secctx, &secctxlen, &pca, encrypt, + &encctx, &encctxlen); if (IS_ERR(de)) rc = PTR_ERR(de); else if (de != NULL) @@ -1051,8 +1135,10 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, if (!rc) { if (it_disposition(it, DISP_OPEN_CREATE)) { /* Dentry instantiated in ll_create_it. */ - rc = ll_create_it(dir, dentry, it, secctx, secctxlen); + rc = ll_create_it(dir, dentry, it, secctx, secctxlen, + encrypt, encctx, encctxlen); security_release_secctx(secctx, secctxlen); + llcrypt_free_ctx(encctx, encctxlen); if (rc) { /* We dget in ll_splice_alias. */ if (de != NULL) @@ -1083,6 +1169,15 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, * already created PCC copy. */ pcc_create_attach_cleanup(dir->i_sb, &pca); + + if (open_flags & O_CREAT && encrypt && + dentry->d_inode) { + rc = ll_set_encflags(dentry->d_inode, encctx, + encctxlen, true); + llcrypt_free_ctx(encctx, encctxlen); + if (rc) + GOTO(out_release, rc); + } } if (dentry->d_inode && it_disposition(it, DISP_OPEN_OPEN)) { @@ -1164,16 +1259,16 @@ static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) */ static int ll_create_it(struct inode *dir, struct dentry *dentry, struct lookup_intent *it, - void *secctx, __u32 secctxlen) + void *secctx, __u32 secctxlen, bool encrypt, + void *encctx, __u32 encctxlen) { struct inode *inode; __u64 bits = 0; int rc = 0; ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p), intent=%s\n", - dentry->d_name.len, dentry->d_name.name, - PFID(ll_inode2fid(dir)), dir, LL_IT2STR(it)); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), intent=%s\n", + dentry, PFID(ll_inode2fid(dir)), dir, LL_IT2STR(it)); rc = it_open_error(DISP_OPEN_CREATE, it); if (rc) @@ -1185,18 +1280,26 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, if ((ll_i2sbi(inode)->ll_flags & LL_SBI_FILE_SECCTX) && secctx != NULL) { - inode_lock(inode); /* must be done before d_instantiate, because it calls * security_d_instantiate, which means a getxattr if security * context is not set yet */ + /* no need to protect selinux_inode_setsecurity() by + * inode_lock. Taking it would lead to a client deadlock + * LU-13617 + */ rc = security_inode_notifysecctx(inode, secctx, secctxlen); - inode_unlock(inode); if (rc) RETURN(rc); } d_instantiate(dentry, inode); + if (encrypt) { + rc = ll_set_encflags(inode, encctx, encctxlen, true); + if (rc) + RETURN(rc); + } + if (!(ll_i2sbi(inode)->ll_flags & LL_SBI_FILE_SECCTX)) { rc = ll_inode_init_security(dentry, inode, dir); if (rc) @@ -1234,16 +1337,17 @@ static int ll_new_node(struct inode *dir, struct dentry *dchild, const char *tgt, umode_t mode, int rdev, __u32 opc) { struct qstr *name = &dchild->d_name; - struct ptlrpc_request *request = NULL; - struct md_op_data *op_data; - struct inode *inode = NULL; - struct ll_sb_info *sbi = ll_i2sbi(dir); - int tgt_len = 0; - int err; + struct ptlrpc_request *request = NULL; + struct md_op_data *op_data = NULL; + struct inode *inode = NULL; + struct ll_sb_info *sbi = ll_i2sbi(dir); + int tgt_len = 0; + bool encrypt = false; + int err; - ENTRY; - if (unlikely(tgt != NULL)) - tgt_len = strlen(tgt) + 1; + ENTRY; + if (unlikely(tgt != NULL)) + tgt_len = strlen(tgt) + 1; again: op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name, @@ -1260,6 +1364,24 @@ again: GOTO(err_exit, err); } + if (ll_sbi_has_encrypt(sbi) && + ((IS_ENCRYPTED(dir) && + (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) || + (unlikely(llcrypt_dummy_context_enabled(dir)) && S_ISDIR(mode)))) { + err = llcrypt_get_encryption_info(dir); + if (err) + GOTO(err_exit, err); + if (!llcrypt_has_encryption_key(dir)) + GOTO(err_exit, err = -ENOKEY); + encrypt = true; + } + + if (encrypt) { + err = llcrypt_inherit_context(dir, NULL, op_data, false); + if (err) + GOTO(err_exit, err); + } + err = md_create(sbi->ll_md_exp, op_data, tgt, tgt_len, mode, from_kuid(&init_user_ns, current_fsuid()), from_kgid(&init_user_ns, current_fsgid()), @@ -1338,20 +1460,29 @@ again: GOTO(err_exit, err); if (sbi->ll_flags & LL_SBI_FILE_SECCTX) { - inode_lock(inode); /* must be done before d_instantiate, because it calls * security_d_instantiate, which means a getxattr if security * context is not set yet */ + /* no need to protect selinux_inode_setsecurity() by + * inode_lock. Taking it would lead to a client deadlock + * LU-13617 + */ err = security_inode_notifysecctx(inode, op_data->op_file_secctx, op_data->op_file_secctx_size); - inode_unlock(inode); if (err) GOTO(err_exit, err); } d_instantiate(dchild, inode); + if (encrypt) { + err = ll_set_encflags(inode, op_data->op_file_encctx, + op_data->op_file_encctx_size, true); + if (err) + GOTO(err_exit, err); + } + if (!(sbi->ll_flags & LL_SBI_FILE_SECCTX)) { err = ll_inode_init_security(dchild, inode, dir); if (err) @@ -1366,20 +1497,18 @@ err_exit: if (!IS_ERR_OR_NULL(op_data)) ll_finish_md_op_data(op_data); - return err; + RETURN(err); } static int ll_mknod(struct inode *dir, struct dentry *dchild, umode_t mode, dev_t rdev) { - struct qstr *name = &dchild->d_name; ktime_t kstart = ktime_get(); int err; ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p) mode %o dev %x\n", - name->len, name->name, PFID(ll_inode2fid(dir)), dir, - mode, rdev); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p) mode %o dev %x\n", + dchild, PFID(ll_inode2fid(dir)), dir, mode, rdev); if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) mode &= ~current_umask(); @@ -1421,17 +1550,16 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE, cfs_fail_val); - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p), " - "flags=%u, excl=%d\n", dentry->d_name.len, - dentry->d_name.name, PFID(ll_inode2fid(dir)), - dir, mode, want_excl); + CDEBUG(D_VFSTRACE, + "VFS Op:name=%pd, dir="DFID"(%p), flags=%u, excl=%d\n", + dentry, PFID(ll_inode2fid(dir)), dir, mode, want_excl); /* Using mknod(2) to create a regular file is designed to not recognize * volatile file name, so we use ll_mknod() here. */ rc = ll_mknod(dir, dentry, mode, 0); - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, unhashed %d\n", - dentry->d_name.len, dentry->d_name.name, d_unhashed(dentry)); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, unhashed %d\n", + dentry, d_unhashed(dentry)); if (!rc) ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_CREATE, @@ -1443,14 +1571,12 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, static int ll_symlink(struct inode *dir, struct dentry *dchild, const char *oldpath) { - struct qstr *name = &dchild->d_name; ktime_t kstart = ktime_get(); int err; ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p), target=%.*s\n", - name->len, name->name, PFID(ll_inode2fid(dir)), - dir, 3000, oldpath); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), target=%.*s\n", + dchild, PFID(ll_inode2fid(dir)), dir, 3000, oldpath); err = ll_new_node(dir, dchild, oldpath, S_IFLNK | S_IRWXUGO, 0, LUSTRE_OPC_SYMLINK); @@ -1474,9 +1600,14 @@ static int ll_link(struct dentry *old_dentry, struct inode *dir, int err; ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op: inode="DFID"(%p), dir="DFID"(%p), " - "target=%.*s\n", PFID(ll_inode2fid(src)), src, - PFID(ll_inode2fid(dir)), dir, name->len, name->name); + CDEBUG(D_VFSTRACE, + "VFS Op: inode="DFID"(%p), dir="DFID"(%p), target=%pd\n", + PFID(ll_inode2fid(src)), src, + PFID(ll_inode2fid(dir)), dir, new_dentry); + + err = llcrypt_prepare_link(old_dentry, dir, new_dentry); + if (err) + RETURN(err); op_data = ll_prep_md_op_data(NULL, src, dir, name->name, name->len, 0, LUSTRE_OPC_ANY, NULL); @@ -1499,13 +1630,12 @@ out: static int ll_mkdir(struct inode *dir, struct dentry *dchild, umode_t mode) { - struct qstr *name = &dchild->d_name; ktime_t kstart = ktime_get(); int err; ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p)\n", - name->len, name->name, PFID(ll_inode2fid(dir)), dir); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p)\n", + dchild, PFID(ll_inode2fid(dir)), dir); if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) mode &= ~current_umask(); @@ -1530,16 +1660,16 @@ static int ll_rmdir(struct inode *dir, struct dentry *dchild) ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p)\n", - name->len, name->name, PFID(ll_inode2fid(dir)), dir); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p)\n", + dchild, PFID(ll_inode2fid(dir)), dir); if (unlikely(d_mountpoint(dchild))) RETURN(-EBUSY); - op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name, name->len, - S_IFDIR, LUSTRE_OPC_ANY, NULL); - if (IS_ERR(op_data)) - RETURN(PTR_ERR(op_data)); + op_data = ll_prep_md_op_data(NULL, dir, NULL, name->name, name->len, + S_IFDIR, LUSTRE_OPC_ANY, NULL); + if (IS_ERR(op_data)) + RETURN(PTR_ERR(op_data)); if (dchild->d_inode != NULL) op_data->op_fid3 = *ll_inode2fid(dchild->d_inode); @@ -1599,8 +1729,8 @@ static int ll_unlink(struct inode *dir, struct dentry *dchild) ENTRY; - CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s, dir="DFID"(%p)\n", - name->len, name->name, PFID(ll_inode2fid(dir)), dir); + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p)\n", + dchild, PFID(ll_inode2fid(dir)), dir); /* * XXX: unlink bind mountpoint maybe call to here, @@ -1665,15 +1795,22 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, return -EINVAL; #endif - CDEBUG(D_VFSTRACE, "VFS Op:oldname=%.*s, src_dir="DFID - "(%p), newname=%.*s, tgt_dir="DFID"(%p)\n", - src_name->len, src_name->name, - PFID(ll_inode2fid(src)), src, tgt_name->len, - tgt_name->name, PFID(ll_inode2fid(tgt)), tgt); + CDEBUG(D_VFSTRACE, + "VFS Op:oldname=%pd, src_dir="DFID"(%p), newname=%pd, tgt_dir="DFID"(%p)\n", + src_dchild, PFID(ll_inode2fid(src)), src, + tgt_dchild, PFID(ll_inode2fid(tgt)), tgt); if (unlikely(d_mountpoint(src_dchild) || d_mountpoint(tgt_dchild))) RETURN(-EBUSY); +#ifdef HAVE_IOPS_RENAME_WITH_FLAGS + err = llcrypt_prepare_rename(src, src_dchild, tgt, tgt_dchild, flags); +#else + err = llcrypt_prepare_rename(src, src_dchild, tgt, tgt_dchild, 0); +#endif + if (err) + RETURN(err); + op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, 0, LUSTRE_OPC_ANY, NULL); if (IS_ERR(op_data))