diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-06-09 21:52:12 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-06-09 21:52:12 +0000 |
commit | b8082aab5049f753abd720a5ef6a113e2acef911 (patch) | |
tree | b0ec52d5543a9487fffa4c3847e706df5dfd7d42 | |
parent | 30eeeae1a12c6cd015c174d9992aa3d0394036ef (diff) |
2008-06-06 Samuel Thibault <samuel.thibault@ens-lyon.org>
* dir-lookup.c (diskfs_S_dir_lookup): Unlock np in case of errors.
-rw-r--r-- | libdiskfs/ChangeLog | 4 | ||||
-rw-r--r-- | libdiskfs/dir-lookup.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index 38fd608a..134468b5 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,3 +1,7 @@ +2008-06-06 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * dir-lookup.c (diskfs_S_dir_lookup): Unlock np in case of errors. + 2007-11-15 Samuel Thibault <samuel.thibault@ens-lyon.org> * dir-rename.c (diskfs_S_dir_rename): Call diskfs_nput (tnp) in diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index 56c9587e..70a0ab3c 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -463,7 +463,10 @@ diskfs_S_dir_lookup (struct protid *dircred, { error = diskfs_create_protid (newpo, dircred->user, &newpi); if (error) - diskfs_release_peropen (newpo); + { + mutex_unlock(&np->lock); + diskfs_release_peropen (newpo); + } } if (! error) @@ -475,7 +478,10 @@ diskfs_S_dir_lookup (struct protid *dircred, error = fshelp_acquire_lock (&np->userlock, &newpi->po->lock_status, &np->lock, LOCK_SH); if (error) - ports_port_deref (newpi); /* Get rid of NEWPI. */ + { + mutex_unlock(&np->lock); + ports_port_deref (newpi); /* Get rid of NEWPI. */ + } } if (! error) |