Unix
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Unix

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 5th, 2008, 06:30 PM
Samuel Thibault
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Unix > dir_lookup, locking and EINTR


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway