[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/7] Fix double call to pthread_mutex_unlock in _treefs_s_dir
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 5/7] Fix double call to pthread_mutex_unlock in _treefs_s_dir_lookup. |
Date: |
Mon, 17 Dec 2012 01:31:32 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Cyril Roelandt, le Mon 17 Dec 2012 00:51:28 +0100, a écrit :
> * libtreefs/dir-lookup.c (_treefs_s_dir_lookup): remove a redundant call to
> pthread_mutex_unlock.
>
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
> libtreefs/dir-lookup.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/libtreefs/dir-lookup.c b/libtreefs/dir-lookup.c
> index ce2acaf..41c34ea 100644
> --- a/libtreefs/dir-lookup.c
> +++ b/libtreefs/dir-lookup.c
> @@ -199,7 +199,6 @@ _treefs_s_dir_lookup (struct treefs_handle *h,
> in the right order. */
> if (strcmp (path, "..") != 0)
> {
> - pthread_mutex_unlock (&node->lock);
> pthread_mutex_lock (&dir->lock);
> pthread_mutex_lock (&node->lock);
At quick sight I don't think this one is spurious, see the comment: this
code seems to be used when one wants to lock dir->lock, which we can
not do when we already have node->lock, that's why we have to release
node->lock before taking dir->lock again.
Samuel
- [PATCH 0/7][Needs testing] Fix double mutex unlocks., Cyril Roelandt, 2012/12/16
- [PATCH 1/7] Fix double call to pthread_mutex_unlock in console_move_mouse()., Cyril Roelandt, 2012/12/16
- [PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key()., Cyril Roelandt, 2012/12/16
- [PATCH 3/7] Fix double call to pthread_mutex_unlock in repeat_event()., Cyril Roelandt, 2012/12/16
- [PATCH 4/7] Fix double call to pthread_mutex_unlock in S_socket_connect., Cyril Roelandt, 2012/12/16
- [PATCH 5/7] Fix double call to pthread_mutex_unlock in _treefs_s_dir_lookup., Cyril Roelandt, 2012/12/16
[PATCH 6/7] Fix double call to pthread_mutex_unlock in diskfs_rename_dir()., Cyril Roelandt, 2012/12/16
[PATCH 7/7] Fix double call to pthread_mutex_unlock in diskfs_S_ifsock_getsockaddr., Cyril Roelandt, 2012/12/16