bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 07/13] trans: return nodes locked when creating fake nodes in


From: Samuel Thibault
Subject: Re: [PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot
Date: Wed, 11 Dec 2013 00:15:34 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Tue 10 Dec 2013 10:20:45 +0100, a écrit :
> Quoting Samuel Thibault (2013-12-10 01:08:21)
> > Justus Winter, le Mon 09 Dec 2013 15:16:35 +0100, a écrit :
> > > +     {
> > > +       pthread_mutex_lock (&(*np)->lock);
> > > +       netfs_nref (*np);     /* Return a reference to the caller.  */
> > > +     }
> > >        pthread_mutex_unlock (&idport_ihash_lock);
> > 
> > Did you check the lock ordering between these two?
> 
> Yes. Previously, new_node added an unlocked node to the hash table and
> unlocked the idport_ihash_lock.
> 
> The use of locks in fakeroot is partially ordered:
> 
> * If you need to pick up the idport_ihash_lock, you need to pick it
>   up first.
> 
> * If you need two nodes locked, lock the parent node first.
> 
> This patch was meant to ensure this for newly created nodes, the
> follow up patch takes advantage of this to fix the locking in
> netfs_S_dir_lookup.

Ok, then Ack.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]