From bfbe0b8d437ec49d8a4bab1def1d3e720af1184f Mon Sep 17 00:00:00 2001 From: jxiong Date: Thu, 21 May 2009 05:07:00 +0000 Subject: [PATCH] b=18881 r=eric.mei,fan.yong Fixed a problem in error handling of IO submit --- lustre/osc/osc_io.c | 12 ++++++++++-- lustre/osc/osc_request.c | 6 +----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 065c808..ba068a8 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -180,8 +180,16 @@ static int osc_io_submit(const struct lu_env *env, osc->oo_oinfo, oap, OSC_FLAGS); - if (result != 0) - break; + /* + * bug 18881: we can't just break out here when + * error occurrs after cl_page_prep has been + * called against the page. The correct + * way is to call page's completion routine, + * as in osc_oap_interrupted. For simplicity, + * we just force osc_set_async_flags_base() to + * not return error. + */ + LASSERT(result == 0); } } else { LASSERT(result < 0); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 8551464..e46a635 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2882,8 +2882,7 @@ int osc_set_async_flags_base(struct client_obd *cli, struct loi_oap_pages *lop; ENTRY; - if (cli->cl_import == NULL || cli->cl_import->imp_invalid) - RETURN(-EIO); + LASSERT(!list_empty(&oap->oap_pending_item)); if (oap->oap_cmd & OBD_BRW_WRITE) { lop = &loi->loi_write_lop; @@ -2891,9 +2890,6 @@ int osc_set_async_flags_base(struct client_obd *cli, lop = &loi->loi_read_lop; } - if (list_empty(&oap->oap_pending_item)) - RETURN(-EINVAL); - if ((oap->oap_async_flags & async_flags) == async_flags) RETURN(0); -- 1.8.3.1