Whamcloud - gitweb
LU-1448 llite: Prevent NULL pointer dereference on disabled OSC
authorJeremy Filizetti <jeremy.filizetti@gmail.com>
Thu, 31 May 2012 12:26:28 +0000 (08:26 -0400)
committerJohann Lombardi <johann@whamcloud.com>
Tue, 12 Jun 2012 20:07:45 +0000 (16:07 -0400)
When a file system is mounted with a disabled OSC reading the import
information from the proc file system can result in a NULL pointer
dereference. The Lustre import on a disabled OSC with remain
in the LUSTRE_IMP_NEW state and imp_connection will remain NULL.

Signed-off-by: Jeremy Filizetti <jeremy.filizetti@gmail.com>
Change-Id: Ib416b2d706ac9797715db2c0ea4f4eaa79bceb22
Reviewed-on: http://review.whamcloud.com/2977
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/obdclass/lprocfs_status.c

index ec5ce20..dddf2c2 100644 (file)
@@ -828,7 +828,8 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count,
                       "       connection_attempts: %u\n"
                       "       generation: %u\n"
                       "       in-progress_invalidations: %u\n",
-                      libcfs_nid2str(imp->imp_connection->c_peer.nid),
+                      imp->imp_connection == NULL ? "<none>" :
+                              libcfs_nid2str(imp->imp_connection->c_peer.nid),
                       imp->imp_conn_cnt,
                       imp->imp_generation,
                       atomic_read(&imp->imp_inval_count));