From: Jinshan Xiong Date: Wed, 2 Jul 2014 22:46:29 +0000 (-0700) Subject: LU-5260 llite: removing ll_cl_context when error occurs X-Git-Tag: 2.6.0-RC1~21 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=4f8ca8e2f0e2d7523169e7ba7f7192600eace5a1 LU-5260 llite: removing ll_cl_context when error occurs The bug is imported from commit f1b9122c of LU-5108. It should have removed ll_cl_context from the list if failed to take lli_write_mutex at: if ((iot == CIT_WRITE) && !(cio->cui_fd->fd_flags & LL_FILE_GROUP_LOCKED)) { if (mutex_lock_interruptible(&lli->lli_write_mutex)) GOTO(out, result = -ERESTARTSYS); Revise it to add ll_context right before cl_io_loop. Signed-off-by: Jinshan Xiong Change-Id: I6532bb8919c13692bd0ceb1ba0d755c1417e5095 Reviewed-on: http://review.whamcloud.com/10955 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 7f60bed..33c8e74 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1166,8 +1166,6 @@ restart: cio->cui_fd = LUSTRE_FPRIVATE(file); vio->cui_io_subtype = args->via_io_subtype; - ll_cl_add(file, env, io); - switch (vio->cui_io_subtype) { case IO_NORMAL: cio->cui_iov = args->u.normal.via_iov; @@ -1191,12 +1189,15 @@ restart: CERROR("Unknow IO type - %u\n", vio->cui_io_subtype); LBUG(); } + + ll_cl_add(file, env, io); result = cl_io_loop(env, io); + ll_cl_remove(file, env); + if (args->via_io_subtype == IO_NORMAL) up_read(&lli->lli_trunc_sem); if (write_mutex_locked) mutex_unlock(&lli->lli_write_mutex); - ll_cl_remove(file, env); } else { /* cl_io_rw_init() handled IO */ result = io->ci_result;