LinearTapeFileSystem / LinearTapeFileSystem/ltfs
ltfs returns 0 even on failed mount (or other fuse errors)
@Magic-Kowel is already working on this.
Since Aug 25, 2025.
- Dominant language
- C
- Stars
- 352
- Forks
- 110
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 2
Description
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 $?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.