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 <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/9334
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Emmanuel Dreyfus 2014-12-24 14:17:21 +01:00 committed by Vijay Bellur
parent a96375c180
commit 4c3a6bc457

View File

@ -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 */