[PATCH] fix CONFIG_DEVFS=y root=<number>

From: Milton Miller (miltonm@bga.com)
Date: Sat Jan 04 2003 - 03:01:38 EST


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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 07 2003 - 22:00:25 EST