From: nasf Date: Wed, 29 Jun 2011 06:46:48 +0000 (+0800) Subject: LU-467 Not reinitialize "cl_io" in "llu_file_prwv()" X-Git-Tag: 2.0.64.0~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5c54c9fcd725417ed3368895d13fd2f002a7bb56 LU-467 Not reinitialize "cl_io" in "llu_file_prwv()" In "llu_file_prwv()", the calling "ccc_env_thread_io(env)" will erases all valid values assigned before into "llu_file_prwv()", then the "io->ci_obj" and "io->ci_lockreq" become unspecified, and then causes subsequent "cl_object_top()" to access NULL pointer and triggers "slp_io_rw_lock()" assertion. Change-Id: I0e878c39d6fb21c5f4d93d037763ae68ee8f102e Signed-off-by: nasf Reviewed-on: http://review.whamcloud.com/1031 Reviewed-by: Jinshan Xiong Reviewed-by: wangdi Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index c8929f4..aea2261 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -30,6 +30,9 @@ * Use is subject to license terms. */ /* + * Copyright (c) 2011 Whamcloud, Inc. + */ +/* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * @@ -329,7 +332,8 @@ ssize_t llu_file_prwv(const struct iovec *iovec, int iovlen, if (IS_ERR(env)) RETURN(PTR_ERR(env)); - io = ccc_env_thread_io(env); + /* Do NOT call "ccc_env_thread_io()" again to prevent reinitializing */ + io = &ccc_env_info(env)->cti_io; if (cl_io_rw_init(env, io, session->lis_cmd == OBD_BRW_WRITE?CIT_WRITE: CIT_READ, pos, len) == 0) {