Re: [PATCH] 2.3.99-* fs/romfs/inode.c

From: Bradley D. LaRonde (brad@ltc.com)
Date: Sun Apr 16 2000 - 12:26:56 EST


----- Original Message -----
From: Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
To: Bradley D. LaRonde <brad@ltc.com>
Cc: <linux-kernel@vger.rutgers.edu>
Sent: Sunday, April 16, 2000 12:37 PM
Subject: Re: [PATCH] 2.3.99-* fs/romfs/inode.c

> "Bradley D. LaRonde" <brad@ltc.com> said:
> > Here is a fix by Mike Klar and I for romfs_read_inode and symlinks,
which
> > just oopses in 2.3.99:
> >
> > -----------------------------------------------------
> > diff -u -r1.1.1.4 inode.c
> > --- fs/romfs/inode.c 2000/04/12 03:53:38 1.1.1.4
> > +++ fs/romfs/inode.c 2000/04/16 05:05:43
> > @@ -506,7 +506,8 @@
> > break;
> > case 3:
> > i->i_op = &page_symlink_inode_operations;
> > - i->i_mode = S_IRWXUGO;
> > + i->i_data.a_ops = &romfs_aops;
> > + i->i_mode = ino | S_IRWXUGO;
> ^^^
> Isn't that the inode? Sounds wrong...

It does sound wrong, but I think it is right. At that point ino is
(somewhat confusingly) holding permission flags obtained 21 lines previously
from a lookup in romfs_modemap[]:

        /* Compute permissions */
        ino = romfs_modemap[nextfh & ROMFH_TYPE];

Maybe it would be better to introduce an additional int for holding the
permission flags instead of reusing ino. I don't think it would affect
performance other than maybe eating a word of stack space, and it would make
the code easier to read.

Regards,
Brad

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:09 EST