Whamcloud - gitweb
LU-15284 llite: access lli_lsm_md with lock in all places
[fs/lustre-release.git] / lustre / llite / namei.c
index 68981dc..1b4034b 100644 (file)
@@ -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);
                }