Whamcloud - gitweb
Kick the can for a version check a bit further.
[fs/lustre-release.git] / lustre / osc / osc_io.c
index 696bf99..0070308 100644 (file)
@@ -167,7 +167,6 @@ static int osc_io_submit(const struct lu_env *env,
                        continue;
                 }
 
-               cl_page_list_move(qout, qin, page);
                spin_lock(&oap->oap_lock);
                oap->oap_async_flags = ASYNC_URGENT|ASYNC_READY;
                oap->oap_async_flags |= ASYNC_COUNT_STABLE;
@@ -175,6 +174,12 @@ static int osc_io_submit(const struct lu_env *env,
 
                osc_page_submit(env, opg, crt, brw_flags);
                list_add_tail(&oap->oap_pending_item, &list);
+
+               if (page->cp_sync_io != NULL)
+                       cl_page_list_move(qout, qin, page);
+               else /* async IO */
+                       cl_page_list_del(env, qin, page);
+
                if (++queued == max_pages) {
                        queued = 0;
                        result = osc_queue_sync_pages(env, osc, &list, cmd,
@@ -537,8 +542,10 @@ static void osc_io_setattr_end(const struct lu_env *env,
         int result = 0;
 
        if (cbargs->opc_rpc_sent) {
-               wait_for_completion(&cbargs->opc_sync);
-               result = io->ci_result = cbargs->opc_rc;
+               result = wait_for_completion_killable(&cbargs->opc_sync);
+               if (result == 0)
+                       result = cbargs->opc_rc;
+               io->ci_result = result;
        }
         if (result == 0) {
                 if (oio->oi_lockless) {
@@ -683,7 +690,7 @@ static void osc_io_fsync_end(const struct lu_env *env,
                struct osc_io           *oio    = cl2osc_io(env, slice);
                struct osc_async_cbargs *cbargs = &oio->oi_cbarg;
 
-               wait_for_completion(&cbargs->opc_sync);
+               result = wait_for_completion_killable(&cbargs->opc_sync);
                if (result == 0)
                        result = cbargs->opc_rc;
        }