Whamcloud - gitweb
- Quiet the FIXMEs from CERRORs to CDEBUGs, because they were reducing LLNL
authorpschwan <pschwan>
Thu, 4 Jul 2002 19:58:38 +0000 (19:58 +0000)
committerpschwan <pschwan>
Thu, 4 Jul 2002 19:58:38 +0000 (19:58 +0000)
consoles to a crawl
- more DLM debug infrastructure, mostly preventative.
- check for the forgotten ptlrpc_abort() case in reply_in_callback
- cleanup the intent-test and runfailure-mds

lustre/include/linux/obd_support.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ptlrpc/client.c
lustre/ptlrpc/events.c
lustre/ptlrpc/service.c
lustre/tests/intent-test.sh
lustre/tests/runfailure-mds

index bd10e2b..1a63479 100644 (file)
@@ -110,7 +110,7 @@ do {                                                                         \
 #include <linux/types.h>
 #include <linux/blkdev.h>
 
-#define fixme() CERROR("FIXME\n");
+#define fixme() CDEBUG(D_OTHER, "FIXME\n");
 
 static inline void OBD_FAIL_WRITE(int id, kdev_t dev)
 {
index 694dac5..c94e9e2 100644 (file)
@@ -83,6 +83,7 @@ void ldlm_lock_put(struct ldlm_lock *lock)
 
         l_lock(nslock);
         lock->l_refc--;
+        LDLM_DEBUG(lock, "after refc--");
         if (lock->l_refc < 0)
                 LBUG();
 
@@ -107,14 +108,13 @@ void ldlm_lock_destroy(struct ldlm_lock *lock)
         l_lock(&lock->l_resource->lr_namespace->ns_lock);
 
         if (!list_empty(&lock->l_children)) {
-                CERROR("lock %p still has children (%p)!\n", lock,
-                       lock->l_children.next);
+                LDLM_DEBUG(lock, "still has children (%p)!",
+                           lock->l_children.next);
                 ldlm_lock_dump(lock);
                 LBUG();
         }
         if (lock->l_readers || lock->l_writers) {
-                CDEBUG(D_INFO, "lock still has references (%d readers, %d "
-                       "writers)\n", lock->l_readers, lock->l_writers);
+                LDLM_DEBUG(lock, "lock still has references");
                 ldlm_lock_dump(lock);
                 LBUG();
         }
@@ -221,7 +221,6 @@ void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh)
         lockh->cookie = lock->l_random;
 }
 
-
 struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *handle)
 {
         struct ldlm_lock *lock = NULL;
@@ -245,7 +244,7 @@ struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *handle)
         EXIT;
  out:
         l_unlock(&lock->l_resource->lr_namespace->ns_lock);
-        return  lock;
+        return lock;
 }
 
 
index 4f778df..1bf08d0 100644 (file)
@@ -252,9 +252,9 @@ static int ldlm_handle_callback(struct ptlrpc_request *req)
                 ldlm_grant_lock(lock);
                 /*  FIXME: we want any completion function, not just wake_up */
                 wake_up(&lock->l_waitq);
-                ldlm_lock_put(lock);
                 lock->l_resource->lr_tmp = NULL;
                 l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+                ldlm_lock_put(lock);
 
                 ldlm_run_ast_work(&rpc_list);
         }
index 487d88e..7f0c58d 100644 (file)
@@ -295,6 +295,7 @@ static int ptlrpc_check_reply(struct ptlrpc_request *req)
         }
 
  out:
+        CDEBUG(D_NET, "req = %p, rc = %d\n", req, rc);
         return rc;
 }
 
index 629840c..b2ae37e 100644 (file)
@@ -72,6 +72,12 @@ static int reply_in_callback(ptl_event_t *ev)
         struct ptlrpc_request *req = ev->mem_desc.user_ptr;
         ENTRY;
 
+        if (req->rq_xid == 0x5a5a5a5a) {
+                CERROR("Reply received for freed request!  Probably a missing "
+                       "ptlrpc_abort()\n");
+                LBUG();
+        }
+
         if (req->rq_xid != ev->match_bits) {
                 CERROR("Reply packet for wrong request\n");
                 LBUG(); 
index a4591e8..1b8da1e 100644 (file)
@@ -54,7 +54,7 @@ static int ptlrpc_check_event(struct ptlrpc_service *svc,
                 }
 
                 if (err != PTL_EQ_EMPTY) {
-                        CDEBUG(D_NET, "BUG: PtlEQGet returned %d\n", rc);
+                        CERROR("BUG: PtlEQGet returned %d\n", rc);
                         LBUG();
                 }
 
index 232801b..7837b62 100755 (executable)
 OST=`../utils/obdctl name2dev OSCDEV`
 MDS=`../utils/obdctl name2dev MDCDEV`
 
-mkdir /mnt/lustre/foo
-mkdir /mnt/lustre/foo2
+remount() {
+    umount /mnt/lustre || exit -1
+    debugctl clear
+    mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre || exit -1
+}
 
-mkdir /mnt/lustre/foo
+# Test mkdir
+mkdir /mnt/lustre/dir
+mkdir /mnt/lustre/dir2
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+# Test mkdir on existing directory
+mkdir /mnt/lustre/dir
 
-mkdir /mnt/lustre/foo
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+# Test mkdir on existing directory with no locks already held
+mkdir /mnt/lustre/dir
 
-./mcreate /mnt/lustre/bar
-./mcreate /mnt/lustre/bar
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+# Use mknod to create a file
+./mcreate /mnt/lustre/file
+# ...on an existing file.
+./mcreate /mnt/lustre/file
 
-./mcreate /mnt/lustre/bar
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+# Use mknod to create a file with no locks already held
+./mcreate /mnt/lustre/file
 
-ls -l /mnt/lustre/bar
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+ls -l /mnt/lustre/file
 
-cat /mnt/lustre/bar
-./mcreate /mnt/lustre/bar2
-cat /mnt/lustre/bar2
-./mcreate /mnt/lustre/bar3
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+cat /mnt/lustre/file
+./mcreate /mnt/lustre/file2
+cat /mnt/lustre/file2
+./mcreate /mnt/lustre/file3
 
-./tchmod 777 /mnt/lustre/bar3
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+./tchmod 777 /mnt/lustre/file3
 
-./mcreate /mnt/lustre/bar4
-./tchmod 777 /mnt/lustre/bar4
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+./mcreate /mnt/lustre/file4
+./tchmod 777 /mnt/lustre/file4
 
-ls -l /mnt/lustre/bar4
-./tchmod 777 /mnt/lustre/bar4
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+ls -l /mnt/lustre/file4
+./tchmod 777 /mnt/lustre/file4
 
-cat /mnt/lustre/bar4
-./tchmod 777 /mnt/lustre/bar4
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+cat /mnt/lustre/file4
+./tchmod 777 /mnt/lustre/file4
 
-touch /mnt/lustre/bar5
-touch /mnt/lustre/bar6
-touch /mnt/lustre/bar5
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+touch /mnt/lustre/file5
+touch /mnt/lustre/file6
+touch /mnt/lustre/file5
 
-touch /mnt/lustre/bar5
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+touch /mnt/lustre/file5
 
-echo foo >> /mnt/lustre/bar
-cat /mnt/lustre/bar
+remount
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+echo foo >> /mnt/lustre/file
+cat /mnt/lustre/file
 
-cat /mnt/lustre/bar
+remount
+
+cat /mnt/lustre/file
 
 echo foo >> /mnt/lustre/iotest
 echo bar >> /mnt/lustre/iotest
 cat /mnt/lustre/iotest
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 cat /mnt/lustre/iotest
 echo baz >> /mnt/lustre/iotest
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 ls /mnt/lustre
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 mkdir /mnt/lustre/new
 ls /mnt/lustre
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 ls /mnt/lustre
 mkdir /mnt/lustre/newer
 ls /mnt/lustre
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 cat /mnt/lustre/iotest
 echo "Testing truncation..."
@@ -123,8 +117,7 @@ echo "trucating to 4 bytes now..."
 ./truncate /mnt/lustre/iotest 4
 cat  /mnt/lustre/iotest
 
-umount /mnt/lustre
-mount -t lustre_lite -o ost=$OST,mds=$MDS none /mnt/lustre
+remount
 
 ls /mnt/lustre
 rmdir /mnt/lustre/foo
index 0f473ff..f2942c3 100755 (executable)
@@ -3,43 +3,9 @@
 SRCDIR="`dirname $0`"
 . $SRCDIR/common.sh
 
-NETWORK=tcp
-LOCALHOST=localhost
-SERVER=localhost
-PORT=1234
+. $SRCDIR/llmount.sh
 
-setup_portals
-setup_lustre
-
-new_fs ext2 /tmp/ost 10000
-OST=$LOOPDEV
-MDSFS=ext3
-new_fs ${MDSFS} /tmp/mds 10000
-MDS=$LOOPDEV
-
-echo 0xffffffff > /proc/sys/portals/debug
-
-$OBDCTL <<EOF
-newdev
-attach mds MDSDEV
-setup ${MDS} ${MDSFS}
-newdev
-attach obdext2 OBDDEV
-setup ${OST}
-newdev
-attach ost OSTDEV
-setup \$OBDDEV
-newdev
-attach ldlm LDLMDEV
-setup
-newdev
-attach osc OSCDEV
-setup -1
-quit
-EOF
-
-MNT="mount -t lustre_lite -o device=`$OBDCTL name2dev OSCDEV` none /mnt/lustre"
-$MNT
+MNT="setup_mount"
 
 test_fail() {
        echo $1 > /proc/sys/lustre/fail_loc