6761574 Plofspath() hangs in ngz on lofs mounts of gz filesystem
authorEdward Pilatowicz <Edward.Pilatowicz@Sun.COM>
Tue, 21 Oct 2008 12:07:10 -0700
changeset 7898 aabf3b67d20c
parent 7897 e520d8258820
child 7899 9ae13a31f010
6761574 Plofspath() hangs in ngz on lofs mounts of gz filesystem
usr/src/lib/libproc/common/Pzone.c
--- a/usr/src/lib/libproc/common/Pzone.c	Tue Oct 21 12:14:32 2008 -0700
+++ b/usr/src/lib/libproc/common/Pzone.c	Tue Oct 21 12:07:10 2008 -0700
@@ -310,8 +310,16 @@
 		mt_find.mnt_mountp = tmp;
 		rv = getmntany(fp, &mt, &mt_find);
 
-		/* We only care about lofs mount points */
-		if ((rv == 0) && (strcmp(mt.mnt_fstype, "lofs") == 0)) {
+		/*
+		 * We only care about lofs mount points.  But we need to
+		 * ignore lofs mounts where the source path is the same
+		 * as the target path.  (This can happen when a non-global
+		 * zone has a lofs mount of a global zone filesystem, since
+		 * the source path can't expose information about global
+		 * zone paths to the non-global zone.)
+		 */
+		if ((rv == 0) && (strcmp(mt.mnt_fstype, "lofs") == 0) &&
+		    (strcmp(mt.mnt_special, mt.mnt_mountp) != 0)) {
 			char tmp2[PATH_MAX + 1];
 
 			/*