Re: [OOPS] Linux-2.6.0-test5-bk

From: Andrew Morton
Date: Wed Sep 10 2003 - 18:06:00 EST


Ranjeet Shetye <ranjeet.shetye2@xxxxxxxxxx> wrote:
>
> Unable to handle kernel paging request at virtual address ffffffef
> printing eip:
> c027184c
> *pde = 00001067
> *pte = 00000000
> Oops: 0000 [#1]
> CPU: 0
> EIP: 0060:[<c027184c>] Not tainted
> EFLAGS: 00010282
> EIP is at atomic_dec_and_lock+0x8/0x54
> eax: ffffffef ebx: ffffffef ecx: ffffffef edx: cf372254
> esi: ffffffef edi: cf743e20 ebp: c12efea8 esp: c12efea0
> ds: 007b es: 007b ss: 0068
> Process swapper (pid: 1, threadinfo=c12ee000 task=c12ed8c0)
> Stack: ffffffef ffffffef c12efec4 c01675e4 ffffffef c05a21b0 ffffffef cf7469b4
> cf743e20 c12efee4 c018aa52 ffffffef 000041ed c018a998 c05f0f80 00000000
> c05f0f80 c12eff00 c018aab1 c05f0f80 cf743e20 c05f0f84 00000000 c05f0f80
> Call Trace:
> [<c01675e4>] dput+0x24/0x227
> [<c018aa52>] create_dir+0x9e/0xa4
> [<c018a998>] init_dir+0x0/0x1c
> [<c018aab1>] sysfs_create_dir+0x36/0x6c
> [<c026eee0>] create_dir+0x1f/0x49
> [<c026f331>] kobject_add+0x4d/0x124

Bug in fs/sysfs/dir.c:create_dir() - sysfs_create() returned -EEXIST and we
turned that into a pointer and did a dput() on it.

Something like this should fix it. The -EEXIST return may be another bug?



diff -puN fs/sysfs/dir.c~sysfs-create_dir-oops-fix fs/sysfs/dir.c
--- 25/fs/sysfs/dir.c~sysfs-create_dir-oops-fix Wed Sep 10 15:41:35 2003
+++ 25-akpm/fs/sysfs/dir.c Wed Sep 10 15:44:42 2003
@@ -24,10 +24,11 @@ static int init_dir(struct inode * inode
static struct dentry *
create_dir(struct kobject * k, struct dentry * p, const char * n)
{
- struct dentry * dentry;
+ struct dentry *dentry, *ret;

down(&p->d_inode->i_sem);
dentry = sysfs_get_dentry(p,n);
+ ret = dentry;
if (!IS_ERR(dentry)) {
int error = sysfs_create(dentry,
S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO,
@@ -36,11 +37,11 @@ create_dir(struct kobject * k, struct de
dentry->d_fsdata = k;
p->d_inode->i_nlink++;
} else
- dentry = ERR_PTR(error);
+ ret = ERR_PTR(error);
dput(dentry);
}
up(&p->d_inode->i_sem);
- return dentry;
+ return ret;
}



_

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