Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With multiple LTFS mounted sometimes unmounts fail until another one is unmounted #469

Closed
tomaz-beltram opened this issue Jun 21, 2024 · 2 comments
Labels

Comments

@tomaz-beltram
Copy link

Describe the bug
When using multiple LTFS mounts in parallel it happens sometimes that the unmount returns "Device or resource busy" error repeatedly for a longer period of time. Also lsof shows that the ltfs process holds open handle for a file on that mountpoint. After another LTFS is successfully unmounted all other also succeeds to unmount. It looks like a handle leak in LTFS/FUSE code. Strange thing is that all parallel LTFS mounts are somehow interrelated.

To Reproduce
Steps to reproduce the behavior:

  1. Mount at least two LTFS tapes in parallel
  2. Start copying data from all mountpoints.
  3. Finish copying on first mountpoint and issue unmount while other mounpoints are still copying data.
  4. See error

Expected behavior
The first LTFS is unmounted w/o error regardless of the other still being busy.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04

Additional context
Data on tape are several 1GB files.

@piste-jp
Copy link
Member

I don't believe such kind of thing happens... because ltfs process never share any resources. On the other hand, I don't have any equipment to confirm this.

Please confirm the only thing that you don't share the mount point within 2 ltfs processes , like /mnt/ltfs and '/mnt/ltfs/ltfs2`.

@tomaz-beltram
Copy link
Author

Thanks for your comment. In the meantime we found out that that cause for file system busy error on unmount was file handle inheritance of forked mount processes. Our main process forks different ltfs mount processes and they inherit open handles of the parent (and its child) processes at the time of fork call. The inherited file handle is closed only on child exit. The solution is to use O_CLOEXEC flag when opening files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants