Bug 689754

Summary: automount hangs on startup when started with an already mounted cifs share
Product: Red Hat Enterprise Linux 6 Reporter: RHEL Program Management <pm-rhel>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: yanfu,wang <yanwang>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.0CC: dejohnso, ikent, jmoyer, jnansi, jwest, kzhang, pm-eus, rwheeler, sprabhu, syeghiay
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: autofs-5.0.5-23.el6_0.1 Doc Type: Bug Fix
Doc Text:
Prior to this update, an attempt to restart the autofs service while a mounted file system was in use caused the service to stop responding upon its startup. This was due to inappropriate locking during the recursive reconstruction of mount trees of pre-existing mounted multi-mount map entries. With this update, the underlying source code has been adapted to avoid the deadlock during the mount tree reconstruction, so that autofs now starts as expected. Additionally, this update prevents autofs from occasionally terminating with a segmentation fault upon a map entry lookup.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-31 07:57:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 650009    
Bug Blocks:    

Description RHEL Program Management 2011-03-22 11:27:16 UTC
This bug has been copied from bug #650009 and has been proposed
to be backported to 6.0 z-stream (EUS).

Comment 5 yanfu,wang 2011-03-24 07:53:53 UTC
verified against https://bugzilla.redhat.com/show_bug.cgi?id=650009#c0 on i386 and x86_64, result is ok:
[root@dell-per210-01 ~]# uname -a
Linux dell-per210-01.lab.bos.redhat.com 2.6.32-71.el6.i686 #1 SMP Wed Sep 1 01:26:34 EDT 2010 i686 i686 i386 GNU/Linux
[root@dell-per210-01 ~]# rpm -qa|grep autofs
autofs-5.0.5-23.el6_0.1.i686
[root@dell-per210-01 ~]# rpm -qa|grep samba 
samba-client-3.5.4-68.el6.i686
samba-winbind-clients-3.5.4-68.el6.i686
samba-3.5.4-68.el6.i686
samba-common-3.5.4-68.el6.i686
[root@dell-per210-01 ~]# rpm -qa|grep cifs-utils
cifs-utils-4.4-5.el6.i686
...
[root@dell-per210-01 ~]# cat /testdir_samba_A/127.0.0.1/automounttest/sambaB 
This is sambaB
[root@dell-per210-01 ~]# sleep 1d > /testdir_samba_A/127.0.0.1/automounttest/hoge &
[1] 4217
[root@dell-per210-01 ~]# service autofs stop
Stopping automount: [  OK  ]
[root@dell-per210-01 ~]# mount
/dev/mapper/vg_dellper21001-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_dellper21001-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
//127.0.0.1/automounttest/ on /testdir_samba_A/127.0.0.1/automounttest type cifs (rw,mand)
[root@dell-per210-01 ~]# pkill sleep
[1]+  Terminated              sleep 1d > /testdir_samba_A/127.0.0.1/automounttest/hoge
[root@dell-per210-01 ~]# mount
/dev/mapper/vg_dellper21001-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_dellper21001-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
//127.0.0.1/automounttest/ on /testdir_samba_A/127.0.0.1/automounttest type cifs (rw,mand)
[root@dell-per210-01 ~]# service autofs start
Starting automount: [  OK  ]
[root@dell-per210-01 ~]# mount
/dev/mapper/vg_dellper21001-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_dellper21001-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
//127.0.0.1/automounttest/ on /testdir_samba_A/127.0.0.1/automounttest type cifs (rw,mand)
[root@dell-per210-01 ~]# cat /testdir_A/test1/testB
This is testB
[root@dell-per210-01 ~]# cat /testdir_samba_A/127.0.0.1/automounttest/sambaB 
This is sambaB


hi Ian,
I found restart autofs service is unnormal:
# /etc/init.d/autofs restart
Starting automount: automount: program is already running.
[  OK  ]

seem there's problem in below, is it right?
function restart() {
        status > /dev/null 2>&1
        if [ $? -eq 0 ]; then
                stop
        fi
        start
}

Comment 6 yanfu,wang 2011-03-24 10:52:58 UTC
I just talk with Ian about the above issue and he said that it's a known problem.
<snip>
(18时30分00秒) raven-au: known problem, will be fixed in upcoming release, fix is to change to "status autofs > /dev/null 2>&1" in init script
(18时31分49秒) yanwang: ok, so the restart autofs service problem will fix in next 6.0.z errata?
(18时34分23秒) raven-au: I don't think there is a z-stream bug for it, it's fixed 6.1
(18时36分31秒) yanwang: how about fix it in this z-stream package too? It's easy and we could re-spin the errata
(18时37分55秒) raven-au: add a comment to the bug and see if we can get the OK from the z-stream folks
</snip>

So EUS folks,
Do we need to fix it and re-build package or just ignore/remain the issue in this release?

Comment 7 Jaromir Hradilek 2011-03-25 14:43:23 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, an attempt to restart the autofs service while a mounted file system was in use caused the service to stop responding upon its startup. This was due to inappropriate locking during the recursive reconstruction of mount trees of pre-existing mounted multi-mount map entries. With this update, the underlying source code has been adapted to avoid the deadlock during the mount tree reconstruction, so that autofs now starts as expected. Additionally, this update prevents autofs from occasionally terminating with a segmentation fault upon a map entry lookup.

Comment 8 yanfu,wang 2011-03-29 02:03:22 UTC
verified against comment #5.

Since no reply from EUS folks, and the autofs service restart problem isn't related to this fix and had fixed in RHEL6.1, so I will let the errata push out. If need fix the autofs restart issue, pls clone bug 624444 for 6.0.z.

Comment 9 errata-xmlrpc 2011-03-31 07:57:59 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0403.html