X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_lib.c;fp=lustre%2Fldlm%2Fldlm_lib.c;h=5086c28e488d0308012585b926d05338f0a09ce0;hb=5e30a2c06176f50f5e17aba68fdae7e38d922d33;hp=5ee714e2f489a2a90835749710eaf5a936bc77da;hpb=c6e4c21c4f8b04abc53c1010a697eb3ada4fb315;p=fs%2Flustre-release.git diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 5ee714e..5086c28e 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -3306,16 +3306,6 @@ void ldlm_dump_export_locks(struct obd_export *exp) #endif #ifdef HAVE_SERVER_SUPPORT -static int target_bulk_timeout(void *data) -{ - ENTRY; - /* - * We don't fail the connection here, because having the export - * killed makes the (vital) call to commitrw very sad. - */ - RETURN(1); -} - static inline const char *bulk2type(struct ptlrpc_request *req) { if (req->rq_bulk_read) @@ -3330,7 +3320,6 @@ int target_bulk_io(struct obd_export *exp, struct ptlrpc_bulk_desc *desc) struct ptlrpc_request *req = desc->bd_req; time64_t start = ktime_get_seconds(); time64_t deadline; - struct l_wait_info lwi; int rc = 0; ENTRY; @@ -3375,20 +3364,19 @@ int target_bulk_io(struct obd_export *exp, struct ptlrpc_bulk_desc *desc) do { time64_t timeoutl = deadline - ktime_get_seconds(); - long timeout_jiffies = timeoutl <= 0 ? - 1 : cfs_time_seconds(timeoutl); time64_t rq_deadline; - lwi = LWI_TIMEOUT_INTERVAL(timeout_jiffies, - cfs_time_seconds(1), - target_bulk_timeout, desc); - rc = l_wait_event(desc->bd_waitq, - !ptlrpc_server_bulk_active(desc) || - exp->exp_failed || - exp->exp_conn_cnt > - lustre_msg_get_conn_cnt(req->rq_reqmsg), - &lwi); - LASSERT(rc == 0 || rc == -ETIMEDOUT); + while (timeoutl >= 0 && + wait_event_idle_timeout( + desc->bd_waitq, + !ptlrpc_server_bulk_active(desc) || + exp->exp_failed || + exp->exp_conn_cnt > + lustre_msg_get_conn_cnt(req->rq_reqmsg), + timeoutl ? cfs_time_seconds(1) : 1) == 0) + timeoutl -= 1; + rc = timeoutl < 0 ? -ETIMEDOUT : 0; + /* Wait again if we changed rq_deadline. */ rq_deadline = READ_ONCE(req->rq_deadline); deadline = start + bulk_timeout;