mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: linux-kernel@vger.kernel.org
Subject: Patch(2.5.48)?: initial ramdisk broken
Date: Mon, 18 Nov 2002 06:27:27 -0800	[thread overview]
Message-ID: <200211181427.GAA01519@baldur.yggdrasil.com> (raw)

	linux-2.5.48 adds some kind of pseudo-filesytem in
init/do_mounts.c.  The expanded code cannot find the initial ramdisk
if you use devfs, due to a problem either with its interpretation of
results from sys_getdents64, or the corresponding implementation in
devfs.  do_read_dir attempts to fill a 512 byte buffer.  getdents
returns 400+ bytes the first time.  Then do_read_dir calls getdents
again, asking it to read the remaining bytes, which I guess is not
enough space to hold an additional entry, to which getdents return
-EINVAL.  I'm not sure who is wrong: getdents or the new do_mounts.c
code that interprets its return values.

	Here is a possible patch, on the assumption that getdents is
right and the new code in do_mounts.c is wrong.  I am not sure of its
correctness, although it works.

	By the way, I'd be interested in knowing the benefits of the
new code in init/do_mounts.c.  A compressed romfs initial ramdisk
has worked fine for me up to this point.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

--- linux-2.5.48/init/do_mounts.c	2002-11-17 20:29:31.000000000 -0800
+++ linux/init/do_mounts.c	2002-11-18 04:21:27.000000000 -0800
@@ -355,17 +355,17 @@
 			break;
 		n = do_read_dir(fd, p, size);
 		if (n > 0) {
 			close(fd);
 			*len = n;
 			return p;
 		}
 		kfree(p);
-		if (n < 0)
+		if (n < 0 && n != -EINVAL)
 			break;
 	}
 	close(fd);
 	return NULL;
 }
 #endif
 
 struct linux_dirent64 {

                 reply	other threads:[~2002-11-18 14:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200211181427.GAA01519@baldur.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®