Autofs with CIFS prevents laptop suspend

Bug #1838046 reported by Mohammad Dahamshi
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
autofs (Ubuntu)
Triaged
Low
Unassigned

Bug Description

I have autofs set to mount two cifs partitions
one from a local server, the second from a virtualbox machine in my laptop
when I stop the virtual machine and try to suspend, I got a message saying: Freezing of task failed after xx seconds
after ~10 seconds, the screen goes off, it appears that the laptop do a partial suspend (the power light doesn't blink), if I press the power button, the laptop wakes up, and sometimes I get a new gnome session (all my windows colsed and start with new gnome)

If I sudo systemctl stop autofs.service and the suspend, everything works good.

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1838046/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Paul White (paulw2u)
affects: ubuntu → autofs (Ubuntu)
Revision history for this message
Bryce Harrington (bryce) wrote :

Thank you for taking the time to report bugs and help make Ubuntu better.

Could you please provide exact steps to reproduce the issue? Please write them under the assumption that the person investigating the bug may not be as familiar with the software as you are (for example, provide explicit preliminary steps to set up a minimum working configuration, if possible in an lxc container or virtual machine).

In particular, you mention having two CIFS mounts. What happens if you have only one or the other? Does the same thing occur with Samba and/or NFS mounts, or only CIFS?

Show also your /etc/auto.* file(s) with your mount configuration, and identify what specific version(s) of autofs and which ubuntu release(s) you've tested that have (or do not have) the issue.

Please write the steps in a comment, and then change the bug status back to "New", so that we can begin working on it.

Changed in autofs (Ubuntu):
status: New → Incomplete
summary: - Autofs prevent laptop suspend
+ Autofs with CIFS prevents laptop suspend
Revision history for this message
Mohammad Dahamshi (mdahamshi) wrote :

Linux automount version 5.1.2
ubntu 18.04

auto.master:
/home/mohammad/cifs /etc/auto.cifs --timeout 60

auto.cifs:

disk1 -fstype=cifs,rw,uid=1000,gid=100,credentials=/etc/auto.smb.mmd,file_mode=0770,dir_mode=0770 ://plaqless.org/disk1

disk2 -fstype=cifs,rw,uid=1000,gid=100,credentials=/etc/auto.smb.mmd,file_mode=0770,dir_mode=0770 ://plaqless.org/disk2

work -fstype=cifs,rw,uid=1000,gid=100,credentials=/etc/auto.smb.mmd,file_mode=0770,dir_mode=0770 ://win7.local/Work

steps to reproduce:
1. cd /home/mohammad/cifs/disk1 (now the disk1 is auto mounted)
2. unplug the LAN cable (or disconnect from the network plaqless.org is on)
3. suspend
4. Freezing of task failed after xx seconds (the bug)

Changed in autofs (Ubuntu):
status: Incomplete → New
Bryce Harrington (bryce)
Changed in autofs (Ubuntu):
importance: Undecided → Low
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Could you please add logs about this? dmesg output, and /var/log/syslog

Revision history for this message
Bryce Harrington (bryce) wrote :

Setting priority as low as this appears to be an atypical use case.

Changed in autofs (Ubuntu):
status: New → Triaged
Revision history for this message
Mohammad Dahamshi (mdahamshi) wrote :

syslog attatchment

Revision history for this message
Mohammad Dahamshi (mdahamshi) wrote :

dmesg attatchment

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Isn't that the default for all network mounts to hang if they are disconnected.
As they want to preserve data at all cost after the disconnect they'd usually need some sort of forced unmount.

I'd expect it might even have hooks to be ok without the unplugged LAN (or disconnected wireless in other bugs that I've seen).

I'm happy that it doesn't do so automatically, CFIS/Samba would try to reconnect to get things working again.

But for your case you might need to explicitly umount them "opting in to any data loss" via something like:
  umount -f <mp>
or
  umount -a -t cifs -l <mp>

Would adding this before suspend/shutdown help in your case?

Revision history for this message
Mohammad Dahamshi (mdahamshi) wrote :

Would adding this before suspend/shutdown help in your case?

I think it would help.

But I think the better solution is to add it after a network disconnect, or to to provide a way to disable auto reconnect, isn't the idea behind autofs to mount on demand ? why to keep trying to reconnect ?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Why reconnect - because it might have stale data I'd guess - even if it is only meta updates.
The TL;DR I guess is - if you can unmount network mounts before disconnecting network.

Yes adding that before suspend/shutdown should help your case - but it is a force option, so unmounting while you still have network is the safer option.

If you happen to know that your connections are unreliable those mounts could also get some options to use only sync transfers and no write caches I guess. That would minimize the potential fallout at the price of some performance.

Disclaimer: I'm not the biggest expert on this, I just shared my experience with it so far.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Let me try this with plain cifs, no autofs. I found this old bug where it was fixed in the kernel for cifs back then: https://bugs.launchpad.net/ubuntu/+source/kdeutils/+bug/24330

Revision history for this message
Günter Knauer (gknauer) wrote :

I can confirm just now the recreation of this suspend/hibernate problem having a CIFS mount to a FRITZ.NAS. Using Ubuntu 18.04.3 LTS, Linux version 4.15.0-72-generic (buildd@lcy01-amd64-026) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) - Lenovo W510 - Only the CIFS unmount before suspend/hibernate will avoid a system freeze! Will this be fixed in coming Linux versions?
Regard, Günter

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks for the confirmation, Günter. We don't have identified a fix yet, what's pending is to try with the latest version of autofs, currently 5.1.6 in Ubuntu Focal. After that, if the bug is still happening, try patches from https://mirrors.edge.kernel.org/pub/linux/daemons/autofs/v5/patches-5.1.6/ which apply on top of 5.1.6, and then, if it's still happening, maybe get in contact with upstream directly.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Another variable in this equation, of course, is cifs itself: the kernel, and/or cifs-utils, the userland package.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.