Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: heads up (namei)



On Fri, Nov 19, 2010 at 04:52:34PM +0900, enami tsugutomo wrote:
 > > I just (finally) committed the next round of namei stuff. This changed
 > > every namei call site, so there's plenty of room for me to have
 > > screwed up.
 > 
 > As I don't have so much time so I've just read following four diffs
 > but kloader.c and ccd.c changes are suspicious, aren't they?

The ccd one is totally wrong, yes. The kloader one seems to be missing
a pathbuf_destroy; is that what you had in mind?

Thanks though, who knows how long it would have taken to find those
the hard way.

The kloader code in question is totally broken in any event; it should
not be calling namei and then vn_open on the same nameidata. Can
someone in a position to test that code make sure it works with the
following patch?


Index: dev/kloader.c
===================================================================
RCS file: /cvsroot/src/sys/dev/kloader.c,v
retrieving revision 1.25
diff -u -p -r1.25 kloader.c
--- dev/kloader.c       19 Nov 2010 09:08:26 -0000      1.25
+++ dev/kloader.c       19 Nov 2010 09:14:20 -0000
@@ -597,13 +597,6 @@ kloader_open(const char *filename)
 
        NDINIT(&nid, LOOKUP, FOLLOW, pb);
 
-       error = namei(&nid);
-       if (error != 0) {
-               PRINTF("%s: namei failed, errno=%d\n", filename, error);
-               pathbuf_destroy(pb);
-               return (NULL);
-       }
-
        error = vn_open(&nid, FREAD, 0);
        if (error != 0) {
                PRINTF("%s: open failed, errno=%d\n", filename, error);


-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index