From: Emoly Liu Date: Mon, 14 Jul 2014 19:50:41 +0000 (+0800) Subject: LU-5261 osc: use wait_for_completion_killable() instead X-Git-Tag: 2.6.51~76 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F11021%2F6;p=fs%2Flustre-release.git LU-5261 osc: use wait_for_completion_killable() instead Use wait_for_completion_killable() instead of wait_for_completion() so that the user process can be killed if there is a problem on the OST. Signed-off-by: Emoly Liu Change-Id: Ia3ed5cb981755483bd2f4c3f2cb4cc90c3ca5207 Reviewed-on: http://review.whamcloud.com/11021 Tested-by: Jenkins Reviewed-by: Jinshan Xiong Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index b2e54a9..0070308 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -542,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) { @@ -688,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; }