[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] libdiskfs: fix deadlock
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] libdiskfs: fix deadlock |
Date: |
Mon, 23 Jun 2014 12:44:17 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Sun 22 Jun 2014 15:45:42 +0200, a écrit :
> Previously, libdiskfs would deadlock on contention on renamedirlock
> due to the lock being taken spuriously.
>
> Found using fsstress from the Linux Test Project.
Wow, good spot!
Ack!
> * libdiskfs/dir-rename.c (diskfs_S_dir_rename): Remove spurious
> pthread_mutex_lock.
> ---
> libdiskfs/dir-rename.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c
> index ff9dead..9ac4839 100644
> --- a/libdiskfs/dir-rename.c
> +++ b/libdiskfs/dir-rename.c
> @@ -77,7 +77,6 @@ diskfs_S_dir_rename (struct protid *fromcred,
> if (pthread_mutex_trylock (&renamedirlock))
> {
> diskfs_nrele (fnp);
> - pthread_mutex_lock (&renamedirlock);
> goto try_again;
> }
> err = diskfs_rename_dir (fdp, fnp, fromname, tdp, toname, fromcred,
> --
> 2.0.0
>
--
Samuel
<N> un driver qui fait quoi, alors ?
<y> ben pour les bips
<s> pour passer les oops en morse
-+- #ens-mim - vive les rapports de bug -+-