@@ -396,8 +396,29 @@ ev_add_path (char * devname, struct vect
return 2;
}
mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid);
+ if (!pp->size) {
+ condlog(0, "%s: not a valid path %s, "
+ " device size is 0 ", devname, pp->dev);
+ int i = find_slot(vecs->pathvec, (void *)pp);
+ if (i != -1)
+ vector_del_slot(vecs->pathvec, i);
+ free_path(pp);
+ return 1;
+ }
+
rescan:
if (mpp) {
+ if (mpp->size != pp->size) {
+ condlog(0, "%s: failed to add new path %s, "
+ "device size mismatch",
+ devname, pp->dev);
+ int i = find_slot(vecs->pathvec, (void *)pp);
+ if (i != -1)
+ vector_del_slot(vecs->pathvec, i);
+ free_path(pp);
+ return 1;
+ }
+
condlog(4,"%s: adopting all paths for path %s",
mpp->alias, pp->dev);
if (adopt_paths(vecs->pathvec, mpp))