public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix CONFIG_DEVFS=y root=<number>
@ 2003-01-04  8:01 Milton Miller
  2003-01-04  8:36 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Milton Miller @ 2003-01-04  8:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Helge Hafting, Andrew Morton

Based on a patch by Adam J. Richter <adam@yggdrasil.com> [1], this fixes
the problem since 2.5.47 with mounting a devfs=y system with root=<number>

sys_get_dents64 returns -EINVAL if there is not space for an entry, so
we need to activate the loop code to expand the buffer.  

[1] http://marc.theaimsgroup.com/?l=linux-kernel&m=103762980207529&w=2
Tested with 2.5.53-um2


diff -Nru a/init/do_mounts.c b/init/do_mounts.c
--- a/init/do_mounts.c	Sat Jan  4 00:14:34 2003
+++ b/init/do_mounts.c	Sat Jan  4 00:14:34 2003
@@ -333,7 +333,7 @@
 	for (bytes = 0, p = buf; bytes < len; bytes += n, p+=n) {
 		n = sys_getdents64(fd, p, len - bytes);
 		if (n < 0)
-			return -1;
+			return n;
 		if (n == 0)
 			return bytes;
 	}
@@ -361,7 +361,7 @@
 			return p;
 		}
 		kfree(p);
-		if (n < 0)
+		if (n < 0 && n != -EINVAL)
 			break;
 	}
 	close(fd);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-05  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-04  8:01 [PATCH] fix CONFIG_DEVFS=y root=<number> Milton Miller
2003-01-04  8:36 ` Andrew Morton
2003-01-05  7:46   ` Milton Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox