Whamcloud - gitweb
LU-467 Not reinitialize "cl_io" in "llu_file_prwv()"
authornasf <yong.fan@whamcloud.com>
Wed, 29 Jun 2011 06:46:48 +0000 (14:46 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 7 Jul 2011 22:18:29 +0000 (15:18 -0700)
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 <yong.fan@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1031
Reviewed-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/liblustre/rw.c

index c8929f4..aea2261 100644 (file)
@@ -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) {