|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
dir_lookup, locking and EINTR
Hello,
We are still facing some ext2fs hangs sometimes, and I got an interesting backtrace today: Thread 94 (thread 348.94): #0 0x010d753c in mach_msg_trap () from /lib/libc.so.0.3 #1 0x010d7cc9 in mach_msg () from /lib/libc.so.0.3 #2 0x010a3630 in cproc_block () at / #3 0x010a3d1a in __mutex_lock_solid (ptr CCCC 0x8123c6c ) at / #4 0x0104a1e9 in diskfs_release_peropen (po=0x8242640) at / #5 0x0104a402 in diskfs_protid_rele (arg=0x81d0818) at / #6 0x010aa912 in _ports_complete_deallocate (pi=0x81d0818) at / #7 0x010a9421 in ports_port_deref (portstruct=0x81d0818) at / #8 0x01038825 in diskfs_S_dir_lookup (dircred=0x80e9698, path=0x1aedf4c "@test", flags=262154=NNBLCK|WRNLY|EXLCK, mode=0, retry=0x1aebf44, retryname=0x1aebf4c "", returned_port=0x1aec350, returned_port_poly=0x1aebe48) at / dir-lookup.c:478 is as follows: 469 if (! error) 470 { 471 if (flags & EXLCK) 472 error = fshelp_acquire_lock (&np->userlock, &newpi->po->lock_status, 473 &np->lock, LCK_EX); 474 else if (flags & SHLCK) 475 error = fshelp_acquire_lock (&np->userlock, &newpi->po->lock_status, 476 &np->lock, LCK_SH); 477 if (error) 478 ports_port_deref (newpi); /* Get rid of NEWPI. */ 479 } i.e. someone tried to open @test exclusively, but it failed (EINTR), and thus we drop newpi. The problem is that since that's the last reference, it cals _ports_complete_deallocate, which ends up calling diskfs_release_peropen which tries to acquire the lock on np, which we _already_ have, thus the deadlock, which quickly propagates to the /. It looks like we have the same problem with diskfs_create_protid(). Since in case of an error we don't return a locked np, I guess the correct fix is as attached to this mail? Samuel |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Unix > dir_lookup, locking and EINTR |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|