| Summary: | When soft updates is enabled, cpl is not restored during an fsync syscall | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Umesh Krishnaswamy <umesh> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.2-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->feedback Is this still a problem on a recent system? State Changed From-To: feedback->closed Feedback timeout |
I have instrumentation in the syscall path to catch cases where the cpl after the syscall is not 0. I also have soft updates enabled. When I type reboot at which time a some daemons in my system are doing a bunch of fsyncs, I get the following error from my instrumentation. Syscall 95 entered at cpl 0, exited at cpl 3fc0000 (kgdb) bt #0 dumpsys () at ../../kern/kern_shutdown.c:562 #1 0xc018fbab in boot (howto=256) at ../../kern/kern_shutdown.c:317 #2 0xc01903e6 in panic ( fmt=0xc0379be0 "Syscall %d entered at cpl %x, exited at cpl %x\n") at ../../kern/kern_shutdown.c:807 #3 0xc032192f in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 528384, tf_esi = 0, tf_ebp = -1077938608, tf_isp = -577204268, tf_ebx = 7, tf_edx = 1209838208, tf_ecx = 1610641556, tf_eax = 0, tf_trapno = 12, tf_err = 2, tf_eip = 1209555732, tf_cs = 31, tf_eflags = 642, tf_esp = -1077949932, tf_ss = 47}) at ../../i386/i386/trap.c:1450 #4 0xc0314685 in Xint0x80_syscall () at ../../i386/i386/elf_machdep.c:120 (kgdb) p lk $1 = {lkt_spl = 66846720, lkt_held = -1} I do not have any problems when soft updates is not enabled. I guess there is some code in the fsync path that is not doing an splx. I added the fix for 'Free lock before returning from process_worklist_item' (1.88 ffs_softdep.c), but that did not help. How-To-Repeat: 1) Add instrumentation in trap.c to panic if the cpl after a syscall is not zero. 2) Enable softupdates 3) Touch a lot of files 4) Do fsyncs Again, I do not hit this all the time. I have seen it twice in 20 attempts. reboot