From b8c728ec51696c5d17ef09a00b3b193b70a487da Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sun, 26 Jan 2014 23:14:35 +0100 Subject: libnetfs: fix file locking on peropen release * libnetfs/release-peropen.c (netfs_release_peropen): Release the lock on the underlying node if the peropen status indicates it's not unlocked. --- libnetfs/release-peropen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libnetfs/release-peropen.c b/libnetfs/release-peropen.c index d4d3574c..c206b438 100644 --- a/libnetfs/release-peropen.c +++ b/libnetfs/release-peropen.c @@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +#include #include "netfs.h" void @@ -39,6 +40,10 @@ netfs_release_peropen (struct peropen *po) if (po->shadow_root_parent) mach_port_deallocate (mach_task_self (), po->shadow_root_parent); + if (po->lock_status != LOCK_UN) + fshelp_acquire_lock (&po->np->userlock, &po->lock_status, + &po->np->lock, LOCK_UN); + netfs_nput (po->np); free (po->path); -- cgit v1.2.3