All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Albert Herranz <albert_herranz@yahoo.es>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.11-rc2-mm1: kernel bad access while booting diskless client
Date: Thu, 27 Jan 2005 14:23:33 -0800	[thread overview]
Message-ID: <20050127142333.0ba81907.akpm@osdl.org> (raw)
In-Reply-To: <20050127215619.56535.qmail@web52309.mail.yahoo.com>

Albert Herranz <albert_herranz@yahoo.es> wrote:
>
> Hi,
> 
> I'm getting a kernel Oops while booting 2.6.11-rc2-mm1
> on a diskless (nfsroot based) embedded ppc system.
> Vanilla 2.6.11-rc2 works Ok.
> 
> [...]
> VFS: Mounted root (nfs filesystem) readonly.
> Freeing unused kernel memory: 112k init
> INIT: version 2.86 booting
> Oops: kernel access of bad area, sig: 11 [#1]
> [...]
> TASK = c1643ae0[1] 'init' THREAD: c1646000
> Last syscall: 106
> [...]
> NIP [c0060934] vfs_getattr+0x1c/0xa8
> LR [c0060a14] vfs_stat+0x54/0x64
> Call trace:
>  [c0060a14] vfs_sysstat+0x54/0x64
>  [c0060f24] sys_newstat+0x1c/0x54
>  [c0003c40] ret_from_syscall+0x0/0x44
> Kernel panic - not syncing: Attempted to kill init!
> 
> 
> The cause of the bad access is a null inode->i_op
> field that is passed to vfs_getattr() through the
> corresponding struct dentry.
> It triggers when vfs_getattr() blindly tries to check
> inode->i_op->getattr without first checking that
> inode->i_op is useable.
> 
> The attached patch workarounds the problem, by
> checking inode->i_op before using it.
> 
> It is still unknown to me which code change is causing
> now the appearance of the null i_op field on -rc2-mm1.
> But probably you guys have better clues than me.
> 

OK, that's super-helpful, thanks.

> --- a/fs/stat.c	2004-12-24 22:34:02.000000000 +0100
> +++ b/fs/stat.c	2005-01-27 00:52:15.000000000 +0100
> @@ -47,7 +47,7 @@ int vfs_getattr(struct vfsmount *mnt, st
>  	if (retval)
>  		return retval;
>  
> -	if (inode->i_op->getattr)
> +	if (inode->i_op && inode->i_op->getattr)
>  		return inode->i_op->getattr(mnt, dentry, stat);
>  
>  	generic_fillattr(inode, stat);
> 
> 
> 

Can you tell us which filesystem is being bad?  Add this:

	if (!inode->i_op)
		printk("%s is naughty\n", inode->i_sb->s_id);

It's probably NFS - there has been some work done in there in -mm.

  reply	other threads:[~2005-01-27 22:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 21:56 2.6.11-rc2-mm1: kernel bad access while booting diskless client Albert Herranz
2005-01-27 22:23 ` Andrew Morton [this message]
2005-01-27 22:43   ` Albert Herranz
2005-01-27 22:50   ` Andreas Gruenbacher
2005-01-27 23:00     ` Albert Herranz
2005-01-27 23:03     ` Andreas Gruenbacher
2005-01-27 23:10       ` Albert Herranz

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=20050127142333.0ba81907.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=albert_herranz@yahoo.es \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.