[ofa-general] [PATCH] opensm/osm_lid_mgr.c: ignore and overwrite guid2lid (windows)

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Nov 13 14:22:35 PST 2008


Hi Sasha,

When Windows is crashing with BSOD, it might corrupt files that were
previously opened for writing, even if the files are closed. As a result,
we might see corrupted guid2lid file, and OpenSM will exit on such error.
This patch makes SM ignore (and later overwrite) corrupted guid2lid files.

The patch has already been accepted into ofw.

I'm posting it to openib too, so that when some day WinSM will be
synchronized with OpenSM, this fix won't be lost.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_lid_mgr.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index 0c536a8..c135d4a 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -261,6 +261,12 @@ osm_lid_mgr_init(IN osm_lid_mgr_t * const p_mgr, IN osm_sm_t *sm)
 	/* we use the stored guid to lid table if not forced to reassign */
 	if (!p_mgr->p_subn->opt.reassign_lids) {
 		if (osm_db_restore(p_mgr->p_g2l)) {
+#ifndef __WIN__
+			/*
+			 * When Windows is BSODing, it might corrupt files that
+			 * were previously opened for writing, even if the files
+			 * are closed, so we might see corrupted guid2lid file.
+			 */
 			if (p_mgr->p_subn->opt.exit_on_fatal) {
 				osm_log(p_mgr->p_log, OSM_LOG_SYS,
 					"FATAL: Error restoring Guid-to-Lid "
@@ -268,6 +274,7 @@ osm_lid_mgr_init(IN osm_lid_mgr_t * const p_mgr, IN osm_sm_t *sm)
 				status = IB_ERROR;
 				goto Exit;
 			} else
+#endif
 				OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,
 					"ERR 0317: Error restoring Guid-to-Lid "
 					"persistent database\n");
-- 
1.5.1.4




More information about the general mailing list