commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 02/61: Fix spurious unlock on error


From: Samuel Thibault
Subject: [hurd] 02/61: Fix spurious unlock on error
Date: Tue, 27 May 2014 08:32:09 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 58f78ea0c81a106cb2b9220eb9290bef15466cd9
Author: Samuel Thibault <address@hidden>
Date:   Fri Apr 4 20:55:34 2014 +0200

    Fix spurious unlock on error
    
    Thanks Cyril Roelandt for finding the issue.
    
    * libdiskfs/dir-renamed.c (diskfs_rename_dir): On diskfs_lookup error,
    set fnp to NULL to avoid unlocking it spuriously.
---
 libdiskfs/dir-renamed.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c
index 9b7ec3a..9e37e23 100644
--- a/libdiskfs/dir-renamed.c
+++ b/libdiskfs/dir-renamed.c
@@ -209,7 +209,12 @@ diskfs_rename_dir (struct node *fdp, struct node *fnp, 
const char *fromname,
   if (tmpnp)
     diskfs_nrele (tmpnp);
   if (err)
-    goto out;
+    {
+      assert (!tmpnp);
+      /* diskfs_lookup has not locked fnp then, do not unlock it. */
+      fnp = NULL;
+      goto out;
+    }
 
   diskfs_dirremove (fdp, fnp, fromname, ds);
   ds = 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]