bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 06/13] trans: fix locking issue in fakeroot


From: Justus Winter
Subject: [PATCH 06/13] trans: fix locking issue in fakeroot
Date: Mon, 9 Dec 2013 15:16:34 +0100

* trans/fakeroot.c (netfs_attempt_mkfile): Keep dir locked until the
  new node is created.
---
 trans/fakeroot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index bee018e..b97b499 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -614,9 +614,9 @@ netfs_attempt_mkfile (struct iouser *user, struct node *dir,
   file_t newfile;
   error_t err = dir_mkfile (dir->nn->file, O_RDWR|O_EXEC,
                            real_from_fake_mode (mode), &newfile);
-  pthread_mutex_unlock (&dir->lock);
   if (err == 0)
     err = new_node (newfile, MACH_PORT_NULL, 0, O_RDWR|O_EXEC, np);
+  pthread_mutex_unlock (&dir->lock);
   return err;
 }
 
-- 
1.7.10.4




reply via email to

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