From: Niu Yawei Date: Tue, 3 May 2016 07:37:41 +0000 (-0400) Subject: LU-8091 mount: error out properly in server_lsi2mti() X-Git-Tag: 2.8.54~57 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F19933%2F2;p=fs%2Flustre-release.git LU-8091 mount: error out properly in server_lsi2mti() server_lsi2mti() should return an error if no proper NID is initialized, otherwise, target will register successfully with an invalid empty NID. Signed-off-by: Niu Yawei Change-Id: Ia5fd78e4df6344764109486ce1082099054ebf1e Reviewed-on: http://review.whamcloud.com/19933 Tested-by: Jenkins Reviewed-by: Bobi Jam Reviewed-by: Lai Siyao Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount_server.c b/lustre/obdclass/obd_mount_server.c index 9945ef0..ca68fb0 100644 --- a/lustre/obdclass/obd_mount_server.c +++ b/lustre/obdclass/obd_mount_server.c @@ -1131,6 +1131,13 @@ static int server_lsi2mti(struct lustre_sb_info *lsi, } } + if (mti->mti_nid_count == 0) { + CERROR("Failed to get NID for server %s, please check whether " + "the target is specifed with improper --servicenode or " + "--network options.\n", mti->mti_svname); + RETURN(-EINVAL); + } + mti->mti_lustre_ver = LUSTRE_VERSION_CODE; mti->mti_config_ver = 0;