ltfs
ltfs copied to clipboard
ltfs returns 0 even on failed mount (or other fuse errors)
Describe the bug
ltfs returns 0 even on a failed mount, as it ignores the return code of fuse_main() on https://github.com/LinearTapeFileSystem/ltfs/blob/adb37220d74e0bdd06dfdf9602a84fcd2f0d82e2/src/main.c#L1337-L1340
The return code of fuse_main() is overwritten a few lines below, so the error is never propagated https://github.com/LinearTapeFileSystem/ltfs/blob/adb37220d74e0bdd06dfdf9602a84fcd2f0d82e2/src/main.c#L1343
I would suggest replacing LTFS_WARN with LTFS_ERR and adding a return ret; right after the ltfsmsg to fix this.
To Reproduce mkdir /tmp/ltfs touch /tmp/ltfs/foo ltfs -o devname=9A700L0077 /tmp/ltfs echo $?