fuse_kern_unmount(): close fd before calling umount
authorNikolaus Rath <Nikolaus@rath.org>
Mon, 11 Sep 2017 10:19:06 +0000 (11:19 +0100)
committerNikolaus Rath <Nikolaus@rath.org>
Mon, 11 Sep 2017 10:19:06 +0000 (11:19 +0100)
This is what the Linux version does, and it fixes a
timeout under FreeBSD when the kernel sends a FUSE_DESTROY
request that is never answered.

lib/mount_bsd.c

index aafde7745574096e943d179cbd59a1b28ceba657..94a11f73ad222dd977cb6a6d82561a961826773c 100644 (file)
@@ -126,8 +126,8 @@ static int fuse_mount_opt_proc(void *data, const char *arg, int key,
 
 void fuse_kern_unmount(const char *mountpoint, int fd)
 {
-       unmount(mountpoint, MNT_FORCE);
        close(fd);
+       unmount(mountpoint, MNT_FORCE);
 }
 
 /* Check if kernel is doing init in background */