From: rread Date: Thu, 22 Apr 2004 21:43:41 +0000 (+0000) Subject: b=2410 X-Git-Tag: v1_8_0_110~486^5~248 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bb7500d3801c18acba469b50f0959dc78b2acbae;p=fs%2Flustre-release.git b=2410 Check for NULL reply in mdc_close. --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index c50c019..6567930 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -15,7 +15,8 @@ tbd Cluster File Systems, Inc. - 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. diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index f7726b8..a524061 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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) { diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index a6fb3a2..8e7dfb8 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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