Whamcloud - gitweb
LU-4925 lmv: validate lock with correct stripe FID
[fs/lustre-release.git] / lustre / llite / namei.c
index 69da17e..6cd0c43 100644 (file)
@@ -512,9 +512,20 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
                struct lookup_intent parent_it = {
                                        .it_op = IT_GETATTR,
                                        .d.lustre.it_lock_handle = 0 };
+               struct lu_fid   fid = ll_i2info(parent)->lli_fid;
+
+               /* If it is striped directory, get the real stripe parent */
+               if (unlikely(ll_i2info(parent)->lli_lsm_md != NULL)) {
+                       rc = md_get_fid_from_lsm(ll_i2mdexp(parent),
+                                                ll_i2info(parent)->lli_lsm_md,
+                                                (*de)->d_name.name,
+                                                (*de)->d_name.len, &fid);
+                       if (rc != 0)
+                               RETURN(rc);
+               }
 
-               if (md_revalidate_lock(ll_i2mdexp(parent), &parent_it,
-                                      &ll_i2info(parent)->lli_fid, NULL)) {
+               if (md_revalidate_lock(ll_i2mdexp(parent), &parent_it, &fid,
+                                      NULL)) {
                        d_lustre_revalidate(*de);
                        ll_intent_release(&parent_it);
                }