• Shayan Pooya's avatar
    Do not fork a new process to unmount if user is privileged · c878ca45
    Shayan Pooya authored
    The root user can issue the umount syscall and does not need the
    fusermount binary. Therefore, it is not necessary to fork and exec a new
    process just to run the umount binary.
    
    Golang has a global lock held for forking (See exec_unix.go in the golang
    source tree):
    "Acquire the fork lock so that no other threads create new fds that are
    not yet close-on-exec before we fork."
    
    So it would be best if processes would refrain from forking
    unnecessarily.
    Signed-off-by: default avatarShayan Pooya <shayan@arista.com>
    c878ca45
mount_linux.go 3.17 KB