Re: patch for clear_inode race -- please test!

Troels Arvin (rhl@www.studmed.ku.dk)
Mon, 07 Jul 1997 13:09:27 +0200


Hi,

At 15:57:37 02-07-97 -0400, Bill Hawes <whawes@star.net> wrote:
>The following patch against 2.0.30 closes a small race condition in
>clear_inode that could result in messed up inode use counts and other
>unpleasantness.

Your patch (and the subsequent fs/buffer.c patch) looked very interesting.
I have had a lot of
Jul 2 19:20:03 www kernel: ncp_free_all_inodes: INODES LEFT!!!
Jul 2 19:20:03 www kernel: ncp_free_all_inodes: freeing inode
messages, so my appetite for inode-related patches is high.

My troubles with the IPX/NCP kernel subsystem once in a while escalate to
Jul 6 19:46:23 www kernel: general protection: 0000
Jul 6 19:46:23 www kernel: CPU: 0
Jul 6 19:46:23 www kernel: EIP: 0010:[schedule+532/648]
Jul 6 19:46:23 www kernel: EFLAGS: 00010286
Jul 6 19:46:23 www kernel: eax: 0000002c ebx: f000ef6f ecx: 0000002c
edx: 001c456c
Jul 6 19:46:23 www kernel: esi: 0087d60c edi: 00000028 ebp: 0064df4c
esp: 0064df40
Jul 6 19:46:23 www kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss:
0018
Jul 6 19:46:23 www kernel: Process httpd (pid: 1901, process nr: 4,
stackpage=0064d000)
Jul 6 19:46:23 www kernel: Stack: 001c4544 0087d60c 0087d624 00d403f0
0015df20 0000002c 00d403f0 00000200
Jul 6 19:46:23 www kernel: 00000200 00d403f0 0015dffc 00d403f0
00000000 01c2aa80 00000000 00000200
Jul 6 19:46:23 www kernel: 00d403f0 00000000 00000200 00d403f0
00000200 00122552 00d403f0 01c2aa80
Jul 6 19:46:23 www kernel: Call Trace: [msdos_format_name+796/856]
[msdos_find+160/188] [sys_write+166/372] [do_signal+277/628]
Jul 6 19:46:23 www kernel: Code: 8b 13 8b 5b 04 85 d2 74 6d 8b 02 83 f8 02
74 07 8b 02 83 f8

The 'Call Trace' line seems almost random; it could also be
Call Trace: [floppy_release_irq_and_dma+328/360] [set_dma_addr+92/208]
[getblk+234/936] [ret_from_sys_call+9/136]
or
[pipe_select+101/292] [sys_vhangup+32/60] [sys_lseek+84/228]
[do_exit+326/488] [sys_wait4+54/832] [do_signal+277/628]

Now, what does the above message have to do with the IPX/NCP subsystems? -
My htdocs feeding Apache are read from a NCPFS-mounted volume - the Web
files reside on a Novell server. There is more information about this in
news:33BC0D63.28E143B1@mdb.ku.dk (comp.os.linux.networking message).
The problem has been reproduced in a completely other setting, so I have
ruled out hardware errors; see above mentioned news-reference.

Back to your inode-related patches. Of course, I had hoped that they would
cure the problems that I'm experiencing. They didn't. But I got a new type
of error message not seen before:
Jul 7 10:18:45 www kernel: clear_inode: inode back in use, count=1
Jul 7 10:18:45 www kernel: kfree of non-kmalloced memory: 014f560c, next=
00000000, order=4
Jul 7 10:18:45 www kernel: general protection: 0000
Jul 7 10:18:45 www kernel: CPU: 0
Jul 7 10:18:45 www kernel: EIP: 0010:[get_root_array+357/372]
Jul 7 10:18:45 www kernel: EFLAGS: 00010287
Jul 7 10:18:45 www kernel: eax: ffffffff ebx: 01883510 ecx: 01883528
edx: 00080000
Jul 7 10:18:45 www kernel: esi: ac850f00 edi: 00000000 ebp: 0145be8c
esp: 0145bcd8
Jul 7 10:18:45 www kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss:
0018
Jul 7 10:18:45 www kernel: Process httpd (pid: 679, process nr: 6,
stackpage=0145b000)
Jul 7 10:18:45 www kernel: Stack: 746f6f72 746f6f00 01ac35e8 01df86e4
00000000 00000000 ac850f00 00080000
Jul 7 10:18:45 www kernel: 013eee20 00000000 001be228 00000000
00000000 01883528 0145bcd8 0145bcd8
Jul 7 10:18:45 www kernel: 0145bce0 00000000 00000000 01883018
001398e2 013eee20 00000000 0024e398
Jul 7 10:18:45 www kernel: Call Trace: [do_dev_queue_xmit+414/468]
[bus_mouse_init+19/240] [dev_ifsioc+1306/1632] [dev_ifsioc+1382/1632]
[ext2_check_blocks_bitmap+230/644] [sync_indirect+77/144] [dev_close+23/184]
Jul 7 10:18:45 www kernel: [find_candidate+95/256]
[trunc_tindirect+444/484] [ext2_truncate+2/360] [parse_options+855/1480]
[sync_buffers+193/420] [sys_dup+68/180] [sys_ioctl+246/268]
[fat_notify_change+203/248]
Jul 7 10:18:45 www kernel: [sys_dup+89/180] [sys_fcntl+51/992]
[sys_fcntl+588/992] [pipe_write+469/516] [do_signal+389/628]
Jul 7 10:18:45 www kernel: Code: 39 7e 48 75 3d 8b 95 80 fe ff ff 8b 42 38
39 46 50 75 2f 8b

The
Jul 7 10:18:45 www kernel: clear_inode: inode back in use, count=1
Jul 7 10:18:45 www kernel: kfree of non-kmalloced memory: 014f560c, next=
00000000, order=4
lines are newcomers after your patches.

I don't know if this is useful for somebody. But I sure hope so, 'cause I'm
desperately seeking a way to connect my Linux box to my Novell server.