[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
- Re: [PATCH 01/13] libfshelp: use a hash table in get-identity.c, (continued)
- [PATCH 08/13] trans: fix reference counting and destruction of fake nodes, Justus Winter, 2013/12/09
- [PATCH 11/13] trans: improve the error handling in fakeauth, Justus Winter, 2013/12/09
- [PATCH 09/13] trans: fix locking in fakeroot's netfs_S_dir_lookup, Justus Winter, 2013/12/09
- [PATCH 12/13] trans: unlock nodes with faked attributes in fakeroot, Justus Winter, 2013/12/09
- [PATCH 05/13] trans: handle invalid responses to dir_lookup requests in fakeroot, Justus Winter, 2013/12/09