From: Vitaly Fertman Date: Mon, 5 Jul 2010 10:56:47 +0000 (+0400) Subject: b=20908 wait on sendpage X-Git-Tag: 2.0.0.51~43 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9be39fc159c58b6e34f4fa09b8c0b49a2ef7881c b=20908 wait on sendpage i=rread i=shadow make the while loop for mdt_sendpage to wail until rpc deadline if it has been prolonged meanwhile but the bulk timeout occurs. --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 47502fc..8aaa75b 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1232,15 +1232,20 @@ static int mdt_sendpage(struct mdt_thread_info *info, if (OBD_FAIL_CHECK(OBD_FAIL_MDS_SENDPAGE)) GOTO(abort_bulk, rc = 0); - timeout = (int) req->rq_deadline - cfs_time_current_sec(); - if (timeout < 0) - CERROR("Req deadline already passed %lu (now: %lu)\n", - req->rq_deadline, cfs_time_current_sec()); - *lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(max(timeout, 1)), - cfs_time_seconds(1), NULL, NULL); - rc = l_wait_event(desc->bd_waitq, !ptlrpc_server_bulk_active(desc) || - exp->exp_failed || exp->exp_abort_active_req, lwi); - LASSERT (rc == 0 || rc == -ETIMEDOUT); + do { + timeout = (int) req->rq_deadline - cfs_time_current_sec(); + if (timeout < 0) + CERROR("Req deadline already passed %lu (now: %lu)\n", + req->rq_deadline, cfs_time_current_sec()); + *lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(max(timeout, 1)), + cfs_time_seconds(1), NULL, NULL); + rc = l_wait_event(desc->bd_waitq, + !ptlrpc_server_bulk_active(desc) || + exp->exp_failed || + exp->exp_abort_active_req, lwi); + LASSERT (rc == 0 || rc == -ETIMEDOUT); + } while ((rc == -ETIMEDOUT) && + (req->rq_deadline > cfs_time_current_sec())); if (rc == 0) { if (desc->bd_success &&