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. Justus