changeset 3079:e31d53b3c780

6489671 lumount problems after luupgrade
author dminer
date Thu, 09 Nov 2006 08:35:31 -0800
parents aa37b7e3c5c7
children deef42200cee
files usr/src/cmd/zoneadmd/vplat.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/zoneadmd/vplat.c	Wed Nov 08 19:55:37 2006 -0800
+++ b/usr/src/cmd/zoneadmd/vplat.c	Thu Nov 09 08:35:31 2006 -0800
@@ -304,19 +304,22 @@
 	for (;;) {
 		struct mnttab *mnp;
 
-		for (mnp = resolve_lofs_mnts; mnp < resolve_lofs_mnt_max;
-		    mnp++) {
+		/* Search in reverse order to find longest match */
+		for (mnp = resolve_lofs_mnt_max - 1; mnp >= resolve_lofs_mnts;
+		    mnp--) {
 			if (mnp->mnt_fstype == NULL ||
 			    mnp->mnt_mountp == NULL ||
-			    mnp->mnt_special == NULL ||
-			    strcmp(mnp->mnt_fstype, MNTTYPE_LOFS) != 0)
+			    mnp->mnt_special == NULL)
 				continue;
 			len = strlen(mnp->mnt_mountp);
 			if (strncmp(mnp->mnt_mountp, path, len) == 0 &&
 			    (path[len] == '/' || path[len] == '\0'))
 				break;
 		}
-		if (mnp >= resolve_lofs_mnt_max)
+		if (mnp < resolve_lofs_mnts)
+			break;
+		/* If it's not a lofs then we're done */
+		if (strcmp(mnp->mnt_fstype, MNTTYPE_LOFS) != 0)
 			break;
 		if (outside_altroot) {
 			char *cp;