From: Marcos Dione Subject: kernel panic in inode_lookup Date: Thu, 30 May 2002 13:45:22 -0300 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20020530164522.GA6478@tempest.styx.org.ar> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from pcmam.fsl.org.ar ([192.168.1.8] helo=tempest) by mail.vialibre.org.ar with esmtp (Exim 3.34 #1 (Debian)) id 17DTSu-0004pS-00 for ; Thu, 30 May 2002 14:11:56 -0300 Received: from mdione by tempest with local (masqmail 0.2.8) id 17DT3C-2Cw-00 for ; Thu, 30 May 2002 13:45:22 -0300 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org 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: struct dentry *ogt_inode_lookup (struct inode *dir, struct dentry *dentry) { int ret; struct inode *inode; ino_t ino; printk ("looking for %s in %d\n", dentry->d_name.name, dir->i_ino); ret= ogt_client_call ("ILOOKUP,%d,%s\n", dir->i_ino, dentry->d_name.name); if (ret==200) { ino= ogt_client_get_ulong (); printk ("dir's superblock's read_inode is %p\n", dir->i_sb->s_op->read_inode); inode= iget (dir->i_sb, ino); if (inode!=NULL) { d_add (dentry, inode); } else { /* taken from ext2/namei.c:81 */ printk ("%s failed\n", dentry->d_name.name); return ERR_PTR (-EACCES); } } /* hook our dentry_ops */ dentry->d_op= &ogt_dentry_ops; return dentry; /* ext2 does something like this */ return NULL; } 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?