Thread (5 messages) 5 messages, 3 authors, 2002-05-30

Re: kernel panic in inode_lookup

From: Jan Hudec <hidden>
Date: 2002-05-30 17:24:02

On Thu, May 30, 2002 at 01:45:22PM -0300, Marcos Dione wrote:
  I'm trying to implement the ilookup function. the problem I face is
a kernel panic. after long hours of debugging, I found out that
get_new_inode:871 tries to use sb->s_op->read_inode(inode);. the
problem is that sb->s_op exists but all pointers are NULL. my function
is the following:
[Sniped the code]
                                                                                  
  the ogt_client_* calls are functions I define to talk to the server
(it's a network distributed filesystem). I guess the error is in the
iget call. I don't know if it's right or wrong to call iget. shoul I
use another way of getting a inode? should I set the i_sb member in
read_inode? the printk line before calling iget tells me that i_sb is
already bad. I mean, it exists, but its ops are all NULL.

  any hints?
It is'n clear to me where you get the inode number, ie. if the function
you call just allocates next free number or somehow compute it from the
request. Anyway, in network filesystem calls to iget DONT make much
sense. iget is method for looking up inodes by some key. It goe through
the inode hash and then fall back to read_inode to create it. If your
inode numer happens to be a sane lookup key, you have to implement the
read_inode method (it should create new inode using get_new_inode or
get_empty_inode and initialize it). If your ino is just a unique key,
then you know you will end up creating a new inode, so go ahead and call
get_new_inode directly.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help