From 93385c87a700259fdfb5500a1c699fc33e4ab449 Mon Sep 17 00:00:00 2001 From: ericm Date: Wed, 20 May 2009 18:52:07 +0000 Subject: [PATCH] branch: HEAD only set READ_COMPLETED flag when read actually succeeded. b=19352 r=jay r=wangdi --- lustre/obdclass/cl_page.c | 2 +- lustre/osc/osc_request.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/cl_page.c b/lustre/obdclass/cl_page.c index d79c6c8..5dcf62d 100644 --- a/lustre/obdclass/cl_page.c +++ b/lustre/obdclass/cl_page.c @@ -1249,7 +1249,7 @@ void cl_page_completion(const struct lu_env *env, ENTRY; CL_PAGE_HEADER(D_TRACE, env, pg, "%i %i\n", crt, ioret); - if (crt == CRT_READ) { + if (crt == CRT_READ && ioret == 0) { PASSERT(env, pg, !(pg->cp_flags & CPF_READ_COMPLETED)); pg->cp_flags |= CPF_READ_COMPLETED; } diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a3fad25..f13fe08 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1480,9 +1480,10 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc) /* The rest of this function executes only for OST_READs */ + /* if unwrap_bulk failed, return -EAGAIN to retry */ rc = sptlrpc_cli_unwrap_bulk_read(req, req->rq_bulk, rc); if (rc < 0) - GOTO(out, rc); + GOTO(out, rc = -EAGAIN); if (rc > aa->aa_requested_nob) { CERROR("Unexpected rc %d (%d requested)\n", rc, -- 1.8.3.1