You are not logged in.

#1 2011-11-15 09:55:51

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Suspend, hibernate and umount

I am having issues with suspend and hibernate on my Acer Iconia Tab w501.

I have a Nas which is mounted and unmounted via network manager using a script in /etc/NetworkManager/dispatcher.d as follows:

#!/bin/bash

INTERFACE=$1 # The interface which is brought up or down
STATUS=$2 # The new state of the interface

case "$STATUS" in
    'up') # $INTERFACE is up
	NAS=eval smbtree -SN | grep STORA

	if test [$NAS != ""]; then
		mount -t cifs -o nounix,file_mode=0777,dir_mode=0777,username=********,password=******** //10.1.1.100/MyLibrary /mnt/library
		mount -t cifs -o nounix,file_mode=0777,dir_mode=0777,username=********,password=******** //10.1.1.100/MyComputers /mnt/computers
	fi
	;;
    'down') # $INTERFACE is down
		umount //10.1.1.100/MyLibrary
		umount //10.1.1.100/MyComputers
	;;
esac

The script works perfectly and the Nas is mounted and unmounted along with the status of the network.

Now if the Nas is mounted, suspend and hibernate both fail (yet the Nas is still unmounted when the network goes down), and it appears to be umount causing the problem (dmesg output below), yet if I manually unmount the Nas first, suspend works perfectly, hibernate appears to work yet immediately wakes up again.

[ 2523.280845] Freezing user space processes ... 
[ 2543.293430] Freezing of tasks failed after 20.01 seconds (1 tasks refusing to freeze, wq_busy=0):
[ 2543.293496] umount          D 00000001000a2a11     0  5456   5455 0x00800004
[ 2543.293505]  ffff88004266dca8 0000000000000086 0000000000000000 00000001801e001b
[ 2543.293515]  ffff880062a93250 ffff88004266dfd8 ffff88004266dfd8 ffff88004266dfd8
[ 2543.293522]  ffffffff8189d020 ffff880062a93250 ffff88005e3fcb00 ffff880037031f98
[ 2543.293530] Call Trace:
[ 2543.293546]  [<ffffffff8114724b>] ? kmem_cache_free+0x13b/0x150
[ 2543.293557]  [<ffffffff8132fa00>] ? kernel_sendmsg+0x40/0x60
[ 2543.293567]  [<ffffffff81405fdf>] schedule+0x3f/0x60
[ 2543.293590]  [<ffffffffa0645841>] wait_for_response.isra.6+0x81/0xd0 [cifs]
[ 2543.293601]  [<ffffffff81084f40>] ? abort_exclusive_wait+0xb0/0xb0
[ 2543.293612]  [<ffffffffa0646161>] SendReceive2+0x1b1/0x350 [cifs]
[ 2543.293623]  [<ffffffffa0646335>] SendReceiveNoRsp+0x35/0x40 [cifs]
[ 2543.293633]  [<ffffffffa0626544>] CIFSSMBTDis+0x94/0xf0 [cifs]
[ 2543.293643]  [<ffffffffa063269d>] cifs_put_tcon+0x9d/0x130 [cifs]
[ 2543.293653]  [<ffffffffa0634a04>] cifs_put_tlink+0x44/0x70 [cifs]
[ 2543.293663]  [<ffffffffa063628f>] cifs_umount+0x5f/0xb0 [cifs]
[ 2543.293672]  [<ffffffffa0624242>] cifs_kill_sb+0x22/0x30 [cifs]
[ 2543.293679]  [<ffffffff8115f64c>] deactivate_locked_super+0x3c/0xa0
[ 2543.293685]  [<ffffffff811600fe>] deactivate_super+0x4e/0x70
[ 2543.293691]  [<ffffffff8117bc88>] mntput_no_expire+0x98/0xe0
[ 2543.293697]  [<ffffffff8117c96c>] sys_umount+0x6c/0x380
[ 2543.293704]  [<ffffffff81409702>] system_call_fastpath+0x16/0x1b

I have tried changing the sleep timeout in /etc/Upower/upower.conf in the hope it would give umount time to exit cleanly but it does not make any difference (come to think of it, it doesn't seem to actually change the timeout before suspend/hibernate activates).

All help greatly appreciated.

Cheers.

Last edited by Padfoot (2011-11-17 07:46:48)

Offline

#2 2011-11-15 22:57:56

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Suspend, hibernate and umount

When I had a problem with a network device and suspend, I reverted first to unloading networkmanager on suspend as described here: https://wiki.archlinux.org/index.php/Pm … owersaving
A cleaner way should be to unmount the NAS on suspend by creating a pm-utils hook as described a bit further down on the same link, but I have not tried that myself.

Offline

#3 2011-11-16 08:24:34

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: Suspend, hibernate and umount

@Strike0

Thanks for the tip. Turns out it is actually the cifs module causing the problem, not umount as mentioned in the OP.

Stopping network manager did the trick, and from the same link, I added the resume hook to my initrd and pointed resume to my swap partition in grub 2 and now hibernate is working too.

For those also having suspend/hibernate issues due to a network share mount, hence the use of cifs, place the following script in /etc/pm/sleep.d, named 10network, and ensure it is owned by root and executable. Replace networkmanager with your selected network daemon.

#!/bin/sh
#
# 10networkmanager : start/stop networkmanager

case "$1" in
hibernate|suspend)
/etc/rc.d/networkmanager stop
;;
thaw|resume)
/etc/rc.d/networkmanager start
;;
*) exit $NA
;;
esac

Cheers.

Offline

#4 2011-11-17 07:46:00

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: Suspend, hibernate and umount

Spoke too soon. cifs is still stopping suspend/hibernate. There seems to be a multitude of bug reports regarding this, going all the way back to 2008, and no resolution. It seems the network is being taken down before the cifs mounts can be unmounted, causing the cifs module to panic and not be able to freeze, thus blocking suspend.

As there appears to be no resolution to this (I won't go into other issues I regularly experience with cifs), I will have to look into other methods of mounting network shares avoiding cifs all together.

Will report back.

Offline

#5 2011-11-17 17:52:01

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Suspend, hibernate and umount

Bad. But thanks for sharing your scripts. I learn from them and others will too.
Not using any network shares here currently, so I am not in a position to point you towards alternatives. In Ubuntu they have Avahi in the default distribution, the wiki here lists a gshare package as well: https://wiki.archlinux.org/index.php/Avahi#NFS
In any way NFS doubtlessly sounds more Unix than SMB to my ears.

Looking forward to read on your progress.

Offline

#6 2011-11-18 08:38:47

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: Suspend, hibernate and umount

Looks like I'm going to be stuck for a while.

My NAS dos not support NFS, only SMB so using cifs is a must.

So I really hope someone can help with this cifs problem. It is a widely reported problem (search linux cifs suspend in google and you will see what I mean) and I am surprised after so many years that it has not been resolved.

Anyway, I'll keep searching.

Cheers.

Offline

#7 2011-11-19 14:11:44

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Suspend, hibernate and umount

Yes, looks bleak that search result indeed.
I stumbled over https://launchpadlibrarian.net/84781620 … ave-.patch
while doing it though. It looks like the Ubuntu team has released some sort of patch very recently.
Cheers.
EDIT: Patch relates to this bug: https://bugs.launchpad.net/ubuntu/oneir … +bug/24330

Last edited by Strike0 (2011-11-19 14:12:53)

Offline

#8 2011-11-26 14:37:57

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Suspend, hibernate and umount

@Padfoot: Just saw it. Maybe have a look at the suggestions here: https://bbs.archlinux.org/viewtopic.php?id=130868

Offline

#9 2011-11-26 21:13:41

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: Suspend, hibernate and umount

Strike0 wrote:

@Padfoot: Just saw it. Maybe have a look at the suggestions here: https://bbs.archlinux.org/viewtopic.php?id=130868

Thanks Strike

It definitely may be related. I know with my cifs mounts, unless I issue the umount command twice on shutdown, the system hangs. So I umount them on logout from my session and again in rc.local.shutdown.

But there also seems to be an issue with the cifs module in the kernel. On suspend, hibernate etc, the umount command works exactly as it should. The cifs mounts are unmounted, but as the network has gone down before cifs can do it's stuff, there is a panic in the module and it prevents the kernel going into freeze.

I did find somewhere on a google search that this is going to be fixed in ther kernel 3.2 series.......so who knows how long we will have to wait for this one.

But the shutdown issue definitely looks promising, as it may be able to be applied to suspend as well.

Cheers.

Offline

Board footer

Powered by FluxBB