Whamcloud - gitweb
LU-15850 llite: pass dmv inherit depth instead of dir depth
[fs/lustre-release.git] / lustre / llite / namei.c
index 68981dc..fc6b20d 100644 (file)
@@ -689,7 +689,7 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
                                       "server returned encryption ctx for "DFID"\n",
                                       PFID(ll_inode2fid(inode)));
                                rc = ll_xattr_cache_insert(inode,
-                                              LL_XATTR_NAME_ENCRYPTION_CONTEXT,
+                                                          xattr_for_enc(inode),
                                                           encctx, encctxlen);
                                if (rc)
                                        CWARN("%s: cannot set enc ctx for "DFID": rc = %d\n",
@@ -784,14 +784,17 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
                struct lookup_intent parent_it = {
                                        .it_op = IT_GETATTR,
                                        .it_lock_handle = 0 };
-               struct lu_fid   fid = ll_i2info(parent)->lli_fid;
+               struct ll_inode_info *lli = ll_i2info(parent);
+               struct lu_fid fid = lli->lli_fid;
 
                /* If it is striped directory, get the real stripe parent */
                if (unlikely(ll_dir_striped(parent))) {
+                       down_read(&lli->lli_lsm_sem);
                        rc = md_get_fid_from_lsm(ll_i2mdexp(parent),
-                                                ll_i2info(parent)->lli_lsm_md,
+                                                lli->lli_lsm_md,
                                                 (*de)->d_name.name,
                                                 (*de)->d_name.len, &fid);
+                       up_read(&lli->lli_lsm_sem);
                        if (rc != 0)
                                GOTO(out, rc);
                }
@@ -876,7 +879,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
        rc = ll_setup_filename(parent, &dentry->d_name, 1, &fname, &fid);
        if ((!rc || rc == -ENOENT) && fname.is_ciphertext_name) {
                spin_lock(&dentry->d_lock);
-               dentry->d_flags |= DCACHE_ENCRYPTED_NAME;
+               dentry->d_flags |= DCACHE_NOKEY_NAME;
                spin_unlock(&dentry->d_lock);
        }
        if (rc == -ENOENT)
@@ -1512,7 +1515,7 @@ static void ll_qos_mkdir_prep(struct md_op_data *op_data, struct inode *dir)
        struct ll_inode_info *lli = ll_i2info(dir);
        struct lmv_stripe_md *lsm;
 
-       op_data->op_dir_depth = lli->lli_dir_depth;
+       op_data->op_dir_depth = lli->lli_inherit_depth ?: lli->lli_dir_depth;
 
        /* parent directory is striped */
        if (unlikely(lli->lli_lsm_md))
@@ -1595,7 +1598,8 @@ again:
        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)))) {
+            (unlikely(ll_sb_has_test_dummy_encryption(dir->i_sb)) &&
+             S_ISDIR(mode)))) {
                err = llcrypt_get_encryption_info(dir);
                if (err)
                        GOTO(err_exit, err);