From: Jeremy Filizetti Date: Thu, 31 May 2012 12:26:28 +0000 (-0400) Subject: LU-1448 llite: Prevent NULL pointer dereference on disabled OSC X-Git-Tag: v1_8_8_60_WC1~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=65b7e5aba970e1143adb29045c6d9c481f6a195c;p=fs%2Flustre-release.git LU-1448 llite: Prevent NULL pointer dereference on disabled OSC 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 Change-Id: Ib416b2d706ac9797715db2c0ea4f4eaa79bceb22 Reviewed-on: http://review.whamcloud.com/2977 Reviewed-by: Bobi Jam Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi --- diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index ec5ce20..dddf2c2 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -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 ? "" : + libcfs_nid2str(imp->imp_connection->c_peer.nid), imp->imp_conn_cnt, imp->imp_generation, atomic_read(&imp->imp_inval_count));