ls hangs for 90 seconds per each disconnected automount
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
ls hangs for 90 seconds per each disconnected automount. gnuls is not similarly blocked.
> time gnuls -al /media/myname/
total 8
drwxr-x---+ 4 root root 4096 Nov 7 12:16 .
drwxr-xr-x 4 root root 4096 Aug 23 16:52 ..
drwxr-xr-x 2 root root 0 Nov 21 23:12 corsair
drwxr-xr-x 2 root root 0 Nov 21 23:12 san1TB
real 0m0.001s
user 0m0.000s
sys 0m0.001s
> time ls -al /media/myname/
total 8
drwxr-x--- 4 root root 4096 Nov 7 12:16 .
drwxr-xr-x 4 root root 4096 Aug 23 16:52 ..
d????????? ? ? ? ? ? corsair
d????????? ? ? ? ? ? san1TB
real 3m0.327s
user 0m0.003s
sys 0m0.003s
This occurs regardless whether the automount is "loaded active waiting" or "loaded active running" as long as the mountpoint is not available. NFS mounts are affected as well.
In Ubuntu 25.10, the issue causes incoming SSH sessions to hang for 90s per each retry of each unavailable automount because the MOTD scripts make use of rust-coreutils stat and ls. https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/2130843
I am opening this bug per the suggestion of @Alonely0 in #9072.
Some context:
> grep "/media/" /etc/fstab
/dev/disk/by-label/corsair /media/myname/corsair auto x-systemd.automount,nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=corsair,noauto,user 0 0
/dev/disk/by-label/san1TB /media/myname/san1TB auto x-systemd.automount,nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=san1TB,noauto,user 0 0
> mount | grep "/media/"
systemd-1 on /media/myname/corsair type autofs (rw,relatime,fd=65,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13402)
systemd-1 on /media/myname/san1TB type autofs (rw,relatime,fd=67,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13405)
The issue occurs in both states:
> systemctl | grep media-
media-myname-corsair.automount loaded active waiting media-myname-corsair.automount
media-myname-san1TB.automount loaded active waiting media-myname-san1TB.automount
and
> systemctl | grep media-
media-myname-corsair.automount loaded active running media-myname-corsair.automount
media-myname-san1TB.automount loaded active running media-myname-san1TB.automount
media-myname-corsair.mount loaded inactive dead start /media/myname/corsair
media-myname-san1TB.mount loaded inactive dead start /media/myname/san1TB
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.
Research direction
Start at the ls command entry point and reproduce the provided comparison against gnuls with disconnected systemd automounts and NFS mounts. Investigate why listing unavailable mountpoints waits 90 seconds per mount; done means ls and related stat use cases return promptly without blocking SSH sessions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100