Whamcloud - gitweb
b=17545 control DCACHE_LUSTRE_INVALID flag with MDS_INODELOCK_LOOKUP lock
authorFan Yong <Yong.Fan@Sun.COM>
Thu, 17 Dec 2009 07:37:33 +0000 (15:37 +0800)
committerRobert Read <rread@sun.com>
Thu, 17 Dec 2009 07:52:28 +0000 (23:52 -0800)
1) "DCACHE_LUSTRE_INVALID" is controlled by "MDS_INODELOCK_LOOKUP" which is corresponding to "IT_LOOKUP", do not skip invalidate for other intent.
2) cleanup locks from former test cases for replay-single test_53d.

i=robert.read
i=jinshan.xiong

lustre/llite/dcache.c
lustre/mdc/mdc_locks.c
lustre/tests/openunlink.c
lustre/tests/replay-single.sh

index d685990..dd7e9c5 100644 (file)
@@ -406,6 +406,9 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
         ll_frob_intent(&it, &lookup_it);
         LASSERT(it);
 
+        if (it->it_op == IT_LOOKUP && !(de->d_flags & DCACHE_LUSTRE_INVALID))
+                GOTO(out_sa, rc = 1);
+
         op_data = ll_prep_md_op_data(NULL, parent, de->d_inode,
                                      de->d_name.name, de->d_name.len,
                                      0, LUSTRE_OPC_ANY, NULL);
index 4fb239f..5606b46 100644 (file)
@@ -1023,8 +1023,7 @@ int mdc_revalidate_lock(struct obd_export *exp,
            owner/group/acls are under lookup lock, we need both
            ibits for GETATTR. */
         policy.l_inodebits.bits = (it->it_op == IT_GETATTR) ?
-                MDS_INODELOCK_UPDATE | MDS_INODELOCK_LOOKUP :
-                MDS_INODELOCK_LOOKUP;
+                MDS_INODELOCK_UPDATE : MDS_INODELOCK_LOOKUP;
 
         mode = ldlm_lock_match(exp->exp_obd->obd_namespace,
                                LDLM_FL_BLOCK_GRANTED, &res_id, LDLM_IBITS,
index d69dff3..aef0c3b 100644 (file)
@@ -91,18 +91,20 @@ int main(int argc, char **argv)
                 getc(stdin);
         }
 
+        fprintf(stderr, "accessing (1)\n");
         if (access(fname, F_OK) == 0) {
                 fprintf(stderr, "%s still exists\n", fname2);
                 exit(1);
         }
 
-        fprintf(stderr, "resetting fd offset\n");
+        fprintf(stderr, "seeking (1)\n");
         rc = lseek(fd, 0, SEEK_SET);
         if (rc) {
                 fprintf(stderr, "seek %s\n", strerror(errno));
                 exit(1);
         }
 
+        fprintf(stderr, "accessing (2)\n");
         if (access(fname, F_OK) == 0) {
                 fprintf(stderr, "%s still exists\n", fname);
                 exit(1);
@@ -138,7 +140,7 @@ int main(int argc, char **argv)
                 exit(1);
         }
 
-        fprintf(stderr, "seeking\n");
+        fprintf(stderr, "seeking (2)\n");
         rc = lseek(fd, 0, SEEK_SET);
         if (rc) {
                 fprintf(stderr, "seek (after unlink trunc) %s\n",
@@ -154,7 +156,7 @@ int main(int argc, char **argv)
                 exit(1);
         }
 
-        fprintf(stderr, "seeking\n");
+        fprintf(stderr, "seeking (3)\n");
         rc = lseek(fd, 0, SEEK_SET);
         if (rc) {
                 fprintf(stderr, "seek (before unlink read) %s\n",
index c6e8b11..2ddf988 100755 (executable)
@@ -1184,6 +1184,7 @@ test_53c() {
 run_test 53c "|X| open request and close request while two MDC requests in flight"
 
 test_53d() {
+        cancel_lru_locks mdc    # cleanup locks from former test cases
         rm -rf $DIR/${tdir}-1 $DIR/${tdir}-2
 
         mkdir -p $DIR/${tdir}-1