[2.5.36] oops when reading /proc/locks
Subsystems (2)
[note: please cc me or linux-fsdevel when reporting file locking bugs; i only read linux-kernel on the web and as time permits]
It looks to me like your dereference comes from this line:
if (fl->fl_file != NULL)
inode = fl->fl_file->f_dentry->d_inode;and, if my terribly weak x86 assembler isn't deceiving me, f_dentry is NULL. Since you can reproduce this at will, could you insert some debugging for me?
if (fl->fl_file != NULL) {
if (fl->fl_file->f_dentry) {
inode = fl->fl_file->f_dentry->d_inode;
} else {
printk(KERN_EMERG "null dentry at %d\n", id);
}
}That will avoid the oops, and tell us who managed to set a file lock on a file without a dentry.
Signature · 1 line
Revolutions do not require corporate support.
OK. Re-compiled the entire kernel with 2.95, and now I get this with 2.5.36:
eth0: Setting promiscuous mode.
device eth0 entered promiscuous mode
device eth0 left promiscuous mode
null dentry at 1
null dentry at 1
Linux version 2.5.36 (root@razor) (gcc version 2.95.4 20011002 (Debian prerelease)) #10 Thu Sep 19 17:20:24 EST 2002
What else can I do to debug this?
--
Burton Windle [email protected]
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.18/init/main.c:461
Quoted 32 lines · Matthew Wilcox
[note: please cc me or linux-fsdevel when reporting file locking bugs; i only read linux-kernel on the web and as time permits]
It looks to me like your dereference comes from this line:
if (fl->fl_file != NULL) inode = fl->fl_file->f_dentry->d_inode;and, if my terribly weak x86 assembler isn't deceiving me,
f_dentryis NULL. Since you can reproduce this at will, could you insert some debugging for me?if (fl->fl_file != NULL) { if (fl->fl_file->f_dentry) { inode = fl->fl_file->f_dentry->d_inode; } else { printk(KERN_EMERG "null dentry at %d\n", id); } }That will avoid the oops, and tell us who managed to set a file lock on a file without a dentry.
--
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 8 lines · Burton Windle
OK. Re-compiled the entire kernel with 2.95, and now I get this with 2.5.36:
eth0: Setting promiscuous mode. device eth0 entered promiscuous mode device eth0 left promiscuous mode null dentry at 1
null dentry at 1
what lock shows up at entry 1 on the list, and then what PID is it? Can you get the command name for that pid, eg cat /proc/<pid>/cmdline?
Signature · 1 line
Revolutions do not require corporate support.
device eth0 left promiscuous mode
null dentry at 1
null dentry at 1
null dentry at 1
null dentry at 1
null dentry at 1
/proc/locks at the time:
1: POSIX *NOINODE* WRITE 235 <none>:0 0 EOF 2: POSIX ADVISORY READ 203 03:02:879683 4 4 3: FLOCK ADVISORY WRITE 214 03:02:1172752 0 EOF 4: POSIX ADVISORY READ 205 03:02:879669 4 4 5: POSIX ADVISORY READ 205 03:02:879612 4 4 6: POSIX ADVISORY WRITE 205 03:02:879616 0 0 7: POSIX ADVISORY READ 203 03:02:879612 4 4 8: POSIX ADVISORY WRITE 203 03:02:879609 0 0
There isnt a pid235.
--
Burton Windle [email protected]
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.18/init/main.c:461
Quoted 16 lines · Matthew Wilcox
Quoted 8 lines · Burton Windle
OK. Re-compiled the entire kernel with 2.95, and now I get this with 2.5.36:
eth0: Setting promiscuous mode. device eth0 entered promiscuous mode device eth0 left promiscuous mode null dentry at 1
null dentry at 1what lock shows up at entry 1 on the list, and then what PID is it? Can you get the command name for that pid, eg cat /proc/<pid>/cmdline?
--
Revolutions do not require corporate support.
Quoted 4 lines · Burton Windle
/proc/locksat the time:1: POSIX *NOINODE* WRITE 235 <none>:0 0 EOF
There isnt a pid235.
Urble? This is definitely a 'shouldn't happen' case. When a task exits, all its file descriptors are closed, which should cause all its locks to be removed. So... I wonder what's going on? Can you run an strace of the program that causes this bad lock to be left around and send that to me?
Signature · 1 line
Revolutions do not require corporate support.
The task that I can reproduce this with is 'ntop'. The system is an up-to-date Debian Testing. Here is line 1 of /proc/locks while ntop is running (hand-copied):
1: POSIX ADVISTORY WRITE 271 03:02:17197 0 EOF
and here is line 1 after ntop is stopped, and after the 'null dentry' error shows up:
1: POSIX *NOINODE* WRITE 271 <none>:0 0 EOF
Do you want the entire strace, or just when the program is exiting?
--
Burton Windle [email protected]
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.18/init/main.c:461
Quoted 14 lines · Matthew Wilcox
Quoted 4 lines · Burton Windle
/proc/locksat the time:1: POSIX *NOINODE* WRITE 235 <none>:0 0 EOF
There isnt a pid235.Urble? This is definitely a 'shouldn't happen' case. When a task exits, all its file descriptors are closed, which should cause all its locks to be removed. So... I wonder what's going on? Can you run an strace of the program that causes this bad lock to be left around and send that to me?
--
Revolutions do not require corporate support.
Quoted 3 lines · Burton Windle
The task that I can reproduce this with is 'ntop'. The system is an up-to-date Debian Testing. Here is line 1 of
/proc/lockswhile ntop is running (hand-copied):
Hmm.. I'm running Debian too -- unstable rather than testing, but they aren't _that_ far out of sync yet. I installed the ntop from testing and while it's running, I get:
1: POSIX ADVISORY WRITE 506 03:02:261447 0 EOF 2: POSIX ADVISORY WRITE 506 03:02:261449 0 EOF 3: POSIX ADVISORY WRITE 506 03:02:261451 0 EOF 4: POSIX ADVISORY WRITE 506 03:02:261448 0 EOF 5: POSIX ADVISORY WRITE 506 03:02:259887 0 EOF 6: POSIX ADVISORY WRITE 506 03:02:259560 0 EOF
(from the ntop process, obviously i have other locks)
After I kill ntop, all these locks are gone, which is what i expect ;-(
Quoted 6 lines
1: POSIX ADVISTORY WRITE 271 03:02:17197 0 EOF
and here is line 1 after ntop is stopped, and after the 'null dentry' error shows up:
1: POSIX *NOINODE* WRITE 271 <none>:0 0 EOF
This is good to see... we're not chasing ghosts at least.
Quoted 1 line
Do you want the entire strace, or just when the program is exiting?
I think I need the entire strace. please send it gzipped and attached (off-list). thanks!
Signature · 1 line
Revolutions do not require corporate support.
Matthew,
Please considing pushing this patch of yours to Linus's tree, as I am still able to reproduce the problem on 2.5.44, and we are getting close to the feature freeze.
With this patch, my kernel still compiles and boots fine, but simply complains instead of oopsing.
Thank you.
fs/locks.c 2002-10-21 12:31:51.000000000 -0500 renamed from fs/locks.c.orig 2002-10-21 12:30:27.000000000 -0500 +8 -3
@@ -1714,9 +1714,14 @@ { struct inode *inode = NULL; - if (fl->fl_file != NULL) - inode = fl->fl_file->f_dentry->d_inode; - + if (fl->fl_file != NULL) { + if (fl->fl_file->f_dentry) { + inode = fl->fl_file->f_dentry->d_inode; + } else { + printk("locks.c: null dentry at %d\n", id); + } + } + out += sprintf(out, "%d:%s ", id, pfx); if (IS_POSIX(fl)) { out += sprintf(out, "%6s %s ",
--
Burton Windle [email protected]
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.18/init/main.c:461
Quoted 32 lines · Matthew Wilcox
[note: please cc me or linux-fsdevel when reporting file locking bugs; i only read linux-kernel on the web and as time permits]
It looks to me like your dereference comes from this line:
if (fl->fl_file != NULL) inode = fl->fl_file->f_dentry->d_inode;and, if my terribly weak x86 assembler isn't deceiving me,
f_dentryis NULL. Since you can reproduce this at will, could you insert some debugging for me?if (fl->fl_file != NULL) { if (fl->fl_file->f_dentry) { inode = fl->fl_file->f_dentry->d_inode; } else { printk(KERN_EMERG "null dentry at %d\n", id); } }That will avoid the oops, and tell us who managed to set a file lock on a file without a dentry.
--
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 3 lines · Burton Windle
Please considing pushing this patch of yours to Linus's tree, as I am still able to reproduce the problem on 2.5.44, and we are getting close to the feature freeze.
Definitely not, I need to fix this problem properly; this just papers over the problem. Fixing bugs is not a feature and is unaffected by the feature freeze.
Signature · 1 line
Revolutions do not require corporate support.