Whamcloud - gitweb
b=18881
authorjxiong <jxiong>
Thu, 21 May 2009 05:07:00 +0000 (05:07 +0000)
committerjxiong <jxiong>
Thu, 21 May 2009 05:07:00 +0000 (05:07 +0000)
r=eric.mei,fan.yong

Fixed a problem in error handling of IO submit

lustre/osc/osc_io.c
lustre/osc/osc_request.c

index 065c808..ba068a8 100644 (file)
@@ -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);
index 8551464..e46a635 100644 (file)
@@ -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);