Whamcloud - gitweb
LU-15913 mdt: disable parallel rename for striped dirs
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index 69cd0bb..3c5ebd5 100644 (file)
@@ -2396,6 +2396,15 @@ out_child:
 unlock_parent:
        if (lhp)
                mdt_object_unlock(info, parent, lhp, 1);
+       if (rc == -ENOENT) {
+               /* return -ENOKEY instead of -ENOENT to encryption-unaware
+                * client if trying to access an encrypted file
+                */
+               int rc2 = mdt_check_enc(info, parent);
+
+               if (rc2)
+                       rc = rc2;
+       }
        return rc;
 }
 
@@ -4570,13 +4579,14 @@ static int mdt_intent_getattr(enum ldlm_intent_flags it_opc,
        rc = mdt_getattr_name_lock(info, lhc, child_bits, ldlm_rep);
        ldlm_rep->lock_policy_res2 = clear_serious(rc);
 
-        if (mdt_get_disposition(ldlm_rep, DISP_LOOKUP_NEG))
-                ldlm_rep->lock_policy_res2 = 0;
-        if (!mdt_get_disposition(ldlm_rep, DISP_LOOKUP_POS) ||
-            ldlm_rep->lock_policy_res2) {
-                lhc->mlh_reg_lh.cookie = 0ull;
-                GOTO(out_ucred, rc = ELDLM_LOCK_ABORTED);
-        }
+       if (mdt_get_disposition(ldlm_rep, DISP_LOOKUP_NEG) &&
+           ldlm_rep->lock_policy_res2 != -ENOKEY)
+               ldlm_rep->lock_policy_res2 = 0;
+       if (!mdt_get_disposition(ldlm_rep, DISP_LOOKUP_POS) ||
+           ldlm_rep->lock_policy_res2) {
+               lhc->mlh_reg_lh.cookie = 0ull;
+               GOTO(out_ucred, rc = ELDLM_LOCK_ABORTED);
+       }
 
        rc = mdt_intent_lock_replace(info, lockp, lhc, flags, rc);
         EXIT;
@@ -5985,16 +5995,19 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
        INIT_LIST_HEAD(&m->mdt_squash.rsi_nosquash_nids);
        spin_lock_init(&m->mdt_squash.rsi_lock);
        spin_lock_init(&m->mdt_lock);
-       m->mdt_enable_remote_dir = 1;
-       m->mdt_enable_striped_dir = 1;
+       m->mdt_enable_chprojid_gid = 0;
        m->mdt_enable_dir_migration = 1;
        m->mdt_enable_dir_restripe = 0;
        m->mdt_enable_dir_auto_split = 0;
+       m->mdt_enable_parallel_rename_dir = 1;
+       m->mdt_enable_parallel_rename_file = 1;
+       m->mdt_enable_remote_dir = 1;
        m->mdt_enable_remote_dir_gid = 0;
-       m->mdt_enable_chprojid_gid = 0;
        m->mdt_enable_remote_rename = 1;
-       m->mdt_dir_restripe_nsonly = 1;
        m->mdt_enable_remote_subdir_mount = 1;
+       m->mdt_enable_striped_dir = 1;
+       m->mdt_dir_restripe_nsonly = 1;
+       m->mdt_rename_stats.rs_init = ktime_get();
 
        atomic_set(&m->mdt_mds_mds_conns, 0);
        atomic_set(&m->mdt_async_commit_count, 0);