From 4c3a6bc4573013df1912996e77ded48fddc01516 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Wed, 24 Dec 2014 14:17:21 +0100 Subject: Do not use umount -l on non Linux systems Lazy unmount are only supported on Linux. Force umount instead, since this code path is used in emergency exit anyway. On NetBSD, just have the filesystem calling exit, the kernel will unmount. BUG: 1129939 Change-Id: If623ebf60b7a747ea7e78034b6d71ec2241dea4a Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/9334 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- contrib/fuse-lib/mount-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/fuse-lib/mount-common.c b/contrib/fuse-lib/mount-common.c index cd226fa3141..c436cb16a5c 100644 --- a/contrib/fuse-lib/mount-common.c +++ b/contrib/fuse-lib/mount-common.c @@ -251,9 +251,11 @@ fuse_mnt_umount (const char *progname, const char *abs_mnt, lazy ? "-l" : NULL, NULL); GFFUSE_LOGERR ("%s: failed to execute /bin/umount: %s", progname, strerror (errno)); +#elif __NetBSD__ + /* exitting the filesystem causes the umount */ + exit (0); #else - execl ("/sbin/umount", "/sbin/umount", rel_mnt, - lazy ? "-l" : NULL, NULL); + execl ("/sbin/umount", "/sbin/umount", "-f", rel_mnt, NULL); GFFUSE_LOGERR ("%s: failed to execute /sbin/umount: %s", progname, strerror (errno)); #endif /* GF_LINUX_HOST_OS */ -- cgit