Whamcloud - gitweb
many places in the reint path did not use generation numbers with their
authorpschwan <pschwan>
Thu, 31 Oct 2002 15:22:33 +0000 (15:22 +0000)
committerpschwan <pschwan>
Thu, 31 Oct 2002 15:22:33 +0000 (15:22 +0000)
locks; fixed.

lustre/mds/handler.c
lustre/mds/mds_reint.c

index dbd74bf..be6cd27 100644 (file)
@@ -161,6 +161,7 @@ struct dentry *mds_name2locked_dentry(struct obd_device *obd,
                 RETURN(dchild);
 
         res_id[0] = dchild->d_inode->i_ino;
+        res_id[1] = dchild->d_inode->i_generation;
         rc = ldlm_match_or_enqueue(NULL, NULL, obd->obd_namespace, NULL,
                                    res_id, LDLM_PLAIN, NULL, 0, lock_mode,
                                    &flags, ldlm_completion_ast,
@@ -188,6 +189,7 @@ struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
                 RETURN(de);
 
         res_id[0] = de->d_inode->i_ino;
+        res_id[1] = de->d_inode->i_generation;
         rc = ldlm_match_or_enqueue(NULL, NULL, obd->obd_namespace, NULL,
                                    res_id, LDLM_PLAIN, NULL, 0, lock_mode,
                                    &flags, ldlm_completion_ast,
@@ -614,6 +616,7 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req)
 
         lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_CW : LCK_PW;
         res_id[0] = dir->i_ino;
+        res_id[1] = dir->i_generation;
 
         rc = ldlm_lock_match(obd->obd_namespace, res_id, LDLM_PLAIN,
                              NULL, 0, lock_mode, &lockh);
index 45cd424..4e670ca 100644 (file)
@@ -526,6 +526,7 @@ static int mds_reint_link(struct mds_update_record *rec, int offset,
         /* plan to change the link count on this inode: write lock */
         lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_PW : LCK_PW;
         res_id[0] = de_src->d_inode->i_ino;
+        res_id[1] = de_src->d_inode->i_generation;
 
         rc = ldlm_lock_match(obd->obd_namespace, res_id, LDLM_PLAIN,
                              NULL, 0, lock_mode, &srclockh);
@@ -549,6 +550,7 @@ static int mds_reint_link(struct mds_update_record *rec, int offset,
 
         lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_PW : LCK_PW;
         res_id[0] = de_tgt_dir->d_inode->i_ino;
+        res_id[1] = de_tgt_dir->d_inode->i_generation;
 
         rc = ldlm_lock_match(obd->obd_namespace, res_id, LDLM_PLAIN,
                              NULL, 0, lock_mode, &tgtlockh);
@@ -666,6 +668,7 @@ static int mds_reint_rename(struct mds_update_record *rec, int offset,
 
         lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_PW : LCK_PW;
         res_id[0] = de_srcdir->d_inode->i_ino;
+        res_id[1] = de_srcdir->d_inode->i_generation;
 
         rc = ldlm_lock_match(obd->obd_namespace, res_id, LDLM_PLAIN,
                              NULL, 0, lock_mode, &srclockh);
@@ -688,6 +691,7 @@ static int mds_reint_rename(struct mds_update_record *rec, int offset,
 
         lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_PW : LCK_PW;
         res_id[0] = de_tgtdir->d_inode->i_ino;
+        res_id[1] = de_tgtdir->d_inode->i_generation;
 
         rc = ldlm_lock_match(obd->obd_namespace, res_id, LDLM_PLAIN,
                              NULL, 0, lock_mode, &tgtlockh);
@@ -774,6 +778,7 @@ out_rename_denew:
 out_rename_deold:
         if (!rc) {
                 res_id[0] = de_old->d_inode->i_ino;
+                res_id[1] = de_old->d_inode->i_generation;
                 flags = 0;
                 /* Take an exclusive lock on the resource that we're
                  * about to free, to force everyone to drop their