From 95a85db1d3f3366c0c6d589b6cb9bcf64eef0d72 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 4 Dec 1995 22:07:18 +0000 Subject: (diskfs_S_dir_unlink): Don't call fsys_goaway until we've released our lock. --- libdiskfs/dir-unlink.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libdiskfs/dir-unlink.c b/libdiskfs/dir-unlink.c index 071e927e..fcfb6065 100644 --- a/libdiskfs/dir-unlink.c +++ b/libdiskfs/dir-unlink.c @@ -78,14 +78,7 @@ diskfs_S_dir_unlink (struct protid *dircred, diskfs_node_update (np, 1); if (np->dn_stat.st_nlink == 0) - { - error = fshelp_fetch_control (&np->transbox, &control); - if (!error) - { - fsys_goaway (control, FSYS_GOAWAY_UNLINK); - mach_port_deallocate (mach_task_self (), control); - } - } + fshelp_fetch_control (&np->transbox, &control); /* This check is necessary because we might get here on an error while checking the mode on something which happens to be `.'. */ @@ -94,5 +87,12 @@ diskfs_S_dir_unlink (struct protid *dircred, else diskfs_nput (np); mutex_unlock (&dnp->lock); + + if (control) + { + fsys_goaway (control, FSYS_GOAWAY_UNLINK); + mach_port_deallocate (mach_task_self (), control); + } + return error; } -- cgit v1.2.3