Whamcloud - gitweb
LU-8091 mount: error out properly in server_lsi2mti() 33/19933/2
authorNiu Yawei <yawei.niu@intel.com>
Tue, 3 May 2016 07:37:41 +0000 (03:37 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 May 2016 16:48:17 +0000 (16:48 +0000)
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 <yawei.niu@intel.com>
Change-Id: Ia5fd78e4df6344764109486ce1082099054ebf1e
Reviewed-on: http://review.whamcloud.com/19933
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/obd_mount_server.c

index 9945ef0..ca68fb0 100644 (file)
@@ -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;