Whamcloud - gitweb
b=2410
authorrread <rread>
Thu, 22 Apr 2004 21:43:41 +0000 (21:43 +0000)
committerrread <rread>
Thu, 22 Apr 2004 21:43:41 +0000 (21:43 +0000)
Check for NULL reply in mdc_close.

lustre/ChangeLog
lustre/mdc/mdc_request.c
lustre/tests/replay-single.sh

index c50c019..6567930 100644 (file)
@@ -15,7 +15,8 @@ tbd  Cluster File Systems, Inc. <info@clusterfs.com>
        - fix thread race in portals_debug_dumplog() (3122)
        - create lprocfs device entries at setup instead of at attach (1519)
        - common AST error handler, don't evict client on completion race (3145)
-       * miscellania
+       - check for NULL reply in mdc_close (2410)
+       * miscellania
        - allow default OST striping configuration per directory (1414)
 
 2004-03-22  Cluster File Systems, Inc. <info@clusterfs.com>
index f7726b8..a524061 100644 (file)
@@ -496,7 +496,11 @@ int mdc_close(struct obd_export *exp, struct obdo *obdo,
                                NULL, NULL);
         rc = l_wait_event(req->rq_reply_waitq, mdc_close_check_reply(req),
                           &lwi);
-        if (rc == 0) {
+        if (req->rq_repmsg == NULL) {
+                CDEBUG(D_HA, "request failed to send: %p, %d\n", req, 
+                       req->rq_status);
+                rc = req->rq_status;
+        } else if (rc == 0) {
                 LASSERTF(req->rq_repmsg != NULL, "req = %p", req);
                 rc = req->rq_repmsg->status;
                 if (req->rq_repmsg->type == PTL_RPC_MSG_ERR) {
index a6fb3a2..8e7dfb8 100755 (executable)
@@ -378,6 +378,7 @@ test_18() {
     sleep 1 
     rm -f $DIR/$tfile
     touch $DIR/$tfile-2 || return 1
+    echo "pid: $pid will close"
     kill -USR1 $pid
     wait $pid || return 2
 
@@ -865,6 +866,29 @@ test_44() {
 }
 run_test 44 "race in target handle connect"
 
+# Handle failed close
+test_45() {
+    mdcdev=`awk '/mds_svc_MNT/ {print $1}' < /proc/fs/lustre/devices`
+    $LCTL --device $mdcdev recover
+
+    multiop $DIR/$tfile O_c &
+    pid=$!
+
+    # This will cause the CLOSE to fail before even 
+    # allocating a reply buffer
+    $LCTL --device $mdcdev deactivate
+
+    # try the close
+    kill -USR1 $pid
+    wait $pid || return 1
+
+    $LCTL --device $mdcdev activate
+
+    $CHECKSTAT -t file $DIR/$tfile || return 2
+    return 0
+}
+run_test 45 "Handle failed close"
+
 equals_msg test complete, cleaning up
 $CLEANUP