LinearTapeFileSystem / LinearTapeFileSystem/ltfs

ltfs returns 0 even on failed mount (or other fuse errors)

Open
#541 0 comments 0 reactions 2 assignees View on GitHub

@Magic-Kowel is already working on this.

Since Aug 25, 2025.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.