Bug 589573
Summary: | automount hangs on startup when started with an already mounted cifs share | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Sachin Prabhu <sprabhu> | ||||||
Component: | autofs | Assignee: | Ian Kent <ikent> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Jian Li <jiali> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 5.4 | CC: | ikent, jiali, jmoyer, nmurray, qcai, yanwang | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | autofs-5.0.1-0.rc2.149.el5 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 650009 (view as bug list) | Environment: | |||||||
Last Closed: | 2011-07-21 08:44:18 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: | |||||||||
Bug Blocks: | 650009, 650010 | ||||||||
Attachments: |
|
Description
Sachin Prabhu
2010-05-06 13:12:13 UTC
The issue appears to be a cache readlock which is held when calling mount_subtree() from parse_mount() in parse_sun.c. gdb was used to add the following breakpoints in the execution break cache_readlock break cache_writelock break cache_try_writelock break cache_unlock At each breakpoint during the execution I ran the following commands bt to get the backtrace c to continue with the execution. The following readlock doesn't have a corresponding unlock Breakpoint 1, cache_readlock (mc=0x2aaaaad37110) at cache.c:59 59 { (gdb) bt #0 cache_readlock (mc=0x2aaaaad37110) at cache.c:59 #1 0x00002aaaac4bf801 in parse_mount (ap=0x2aaaaad36f60, name=0x2aaaaad46a73 "127.0.0.1", name_len=9, mapent=0x2aaaaad3e980 "-fstype=cifs \t \"/automounttest\" \"://127.0.0.1/automounttest\"", context=0x2aaaaad3e950) at parse_sun.c:1501 #2 0x00002aaaacd25a75 in lookup_mount (ap=0x2aaaaad36f60, name=0x2aaaaad46a73 "127.0.0.1", name_len=9, context=0x2aaaaad3e900) at lookup_program.c:408 #3 0x00002aaaaaabeb29 in lookup_name_file_source_instance (ap=0x2aaaaad36f60, map=0x2aaaaad37060, name=0x2aaaaad46a73 "127.0.0.1", name_len=9) at lookup.c:704 #4 0x00002aaaaaabf876 in lookup_nss_mount (ap=0x2aaaaad36f60, source=0x0, name=0x2aaaaad46a73 "127.0.0.1", name_len=9) at lookup.c:892 #5 0x00002aaaaaac4cc6 in remount_active_mount (ap=0x2aaaaad36f60, me=0x0, type=1) at mounts.c:1220 #6 try_remount (ap=0x2aaaaad36f60, me=0x0, type=1) at mounts.c:1351 #7 0x00002aaaaaab7757 in do_mount_autofs_indirect (ap=0x2aaaaad36f60, root=0x2aaaaad1e2e0 "/testdir_samba_A") at indirect.c:104 #8 0x00002aaaaaab79da in mount_autofs_indirect (ap=0x2aaaaad36f60, root=0x2aaaaad1e2e0 "/testdir_samba_A") at indirect.c:221 #9 0x00002aaaaaab615e in handle_mounts (arg=0x7fffffffbd80) at automount.c:1012 #10 0x00002aaaaaf1473d in start_thread (arg=<value optimized out>) at pthread_create.c:301 #11 0x00002aaaabde4d1d in clone () from /lib64/libc.so.6 (gdb) c Continuing. This results in a later call for a writelock blocking. (gdb) bt #0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71 #1 0x00002aaaacd25332 in lookup_mount (ap=0x2aaaaad36f60, name=0x2aaaaad3fc30 "/testdir_samba_A/127.0.0.1/automounttest", name_len=40, context=0x2aaaaad3e900) at lookup_program.c:149 #2 0x00002aaaaaabeb29 in lookup_name_file_source_instance (ap=0x2aaaaad36f60, map=0x2aaaaad37060, name=0x2aaaaad3fc30 "/testdir_samba_A/127.0.0.1/automounttest", name_len=40) at lookup.c:704 #3 0x00002aaaaaabf876 in lookup_nss_mount (ap=0x2aaaaad36f60, source=0x0, name=0x2aaaaad3fc30 "/testdir_samba_A/127.0.0.1/automounttest", name_len=40) at lookup.c:892 #4 0x00002aaaaaac49e3 in remount_active_mount (ap=0x2aaaaad36f60, me=0x2aaaaad3fb70, type=4) at mounts.c:1153 #5 try_remount (ap=0x2aaaaad36f60, me=0x2aaaaad3fb70, type=4) at mounts.c:1351 #6 0x00002aaaaaabbe32 in mount_autofs_offset (ap=0x2aaaaad36f60, me=0x2aaaaad3fb70, root=0x42820030 "/testdir_samba_A/127.0.0.1", offset=0x4281efd0 "/automounttest") at direct.c:652 #7 0x00002aaaaaac3fde in mount_multi_triggers (ap=0x2aaaaad36f60, me=<value optimized out>, root=0x42820030 "/testdir_samba_A/127.0.0.1", start=26, base=0x2aaaac4ce04b "/") at mounts.c:1461 #8 0x00002aaaac4bf2d0 in mount_subtree (ap=0x2aaaaad36f60, me=0x2aaaaad3f990, name=0x2aaaaad46a73 "127.0.0.1", loc=0x0, options=0x2aaaaad3fb00 "fstype=cifs", ctxt=0x2aaaaad3e950) at parse_sun.c:1221 #9 0x00002aaaac4bfb59 in parse_mount (ap=0x2aaaaad36f60, name=0x2aaaaad46a73 "127.0.0.1", name_len=9, mapent=0x2aaaaad3e980 "-fstype=cifs \t \"/automounttest\" \"://127.0.0.1/automounttest\"", context=0x2aaaaad3e950) at parse_sun.c:1594 #10 0x00002aaaacd25a75 in lookup_mount (ap=0x2aaaaad36f60, name=0x2aaaaad46a73 "127.0.0.1", name_len=9, context=0x2aaaaad3e900) at lookup_program.c:408 #11 0x00002aaaaaabeb29 in lookup_name_file_source_instance (ap=0x2aaaaad36f60, map=0x2aaaaad37060, name=0x2aaaaad46a73 "127.0.0.1", name_len=9) at lookup.c:704 #12 0x00002aaaaaabf876 in lookup_nss_mount (ap=0x2aaaaad36f60, source=0x0, name=0x2aaaaad46a73 "127.0.0.1", name_len=9) at lookup.c:892 #13 0x00002aaaaaac4cc6 in remount_active_mount (ap=0x2aaaaad36f60, me=0x0, type=1) at mounts.c:1220 #14 try_remount (ap=0x2aaaaad36f60, me=0x0, type=1) at mounts.c:1351 #15 0x00002aaaaaab7757 in do_mount_autofs_indirect (ap=0x2aaaaad36f60, root=0x2aaaaad1e2e0 "/testdir_samba_A") at indirect.c:104 #16 0x00002aaaaaab79da in mount_autofs_indirect (ap=0x2aaaaad36f60, root=0x2aaaaad1e2e0 "/testdir_samba_A") at indirect.c:221 #17 0x00002aaaaaab615e in handle_mounts (arg=0x7fffffffbd80) at automount.c:1012 #18 0x00002aaaaaf1473d in start_thread (arg=<value optimized out>) at pthread_create.c:301 #19 0x00002aaaabde4d1d in clone () from /lib64/libc.so.6 (gdb) c Created attachment 412036 [details]
gdb session
gdb session with backtraces taken each time there was a readlock/writelock or unlock.
The process hangs waiting for a writelock on lock with address 0x2aaaaad37110
Grepping for all calls on this lock
$ grep 0x2aaaaad37110 717233.gdb |grep -v Breakpoint
#0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_readlock (mc=0x2aaaaad37110) at cache.c:59
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_readlock (mc=0x2aaaaad37110) at cache.c:59
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_readlock (mc=0x2aaaaad37110) at cache.c:59 <-- *
#0 cache_readlock (mc=0x2aaaaad37110) at cache.c:59
#0 cache_unlock (mc=0x2aaaaad37110) at cache.c:95
#0 cache_writelock (mc=0x2aaaaad37110) at cache.c:71
* - The readlock doesn't have a corresponding unlock. This process then tries to obtain a writelock on the cache with the readlock held. This results in the process hanging.
What revision of autofs is being used here? AFAICS it isn't rev 131 from 5.4. (In reply to comment #3) > What revision of autofs is being used here? > AFAICS it isn't rev 131 from 5.4. OK, my mistake, I'm with it now. Created attachment 412707 [details]
Patch - fix remount locking
A test package which includes the change of comment #5 has been made. It can be found at: http://people.redhat.com/~ikent/autofs-5.0.1-0.rc2.143.bz589573.1.el5 Please test this package and report your results. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release. This bug is verified, test is explained as follows: The environment: #/etc/samba/smb.conf [global] workgroup = MYGROUP security = SHARE guest account = root hosts allow = 127. [automounttest] comment = automounttest path = /testdir_samba_B read only = No guest ok = Yes public = yes [root@hp-xw6400-02 ~]# rpm -qa | grep samba samba-common-3.0.33-3.29.el5_6.2 samba-client-3.0.33-3.29.el5_6.2 samba-3.0.33-3.29.el5_6.2 [root@hp-xw6400-02 ~]# rpm -q autofs autofs-5.0.1-0.rc2.155.el5 [root@hp-xw6400-02 ~]# uname -a Linux hp-xw6400-02.lab.bos.redhat.com 2.6.18-256.el5 #1 SMP Thu Apr 7 19:59:40 EDT 2011 i686 i686 i386 GNU/Linux Some steps for preparation are operated as comment 0. Steps and output : [root@hp-xw6400-02 ~]# cat /testdir_A/test1/testB This is testB [root@hp-xw6400-02 ~]# cat /testdir_samba_A/127.0.0.1/automounttest/sambaB This is sambaB [root@hp-xw6400-02 ~]# sleep 1d > /testdir_samba_A/127.0.0.1/automounttest/hoge & [1] 5327 [root@hp-xw6400-02 ~]# [root@hp-xw6400-02 ~]# service autofs stop Stopping automount: [ OK ] [root@hp-xw6400-02 ~]# mount ........ //127.0.0.1/automounttest on /testdir_samba_A/127.0.0.1/automounttest type cifs (rw,mand) [root@hp-xw6400-02 ~]# pkill sleep [root@hp-xw6400-02 ~]# service autofs start Starting automount: [ OK ] [1]+ Terminated sleep 1d > /testdir_samba_A/127.0.0.1/automounttest/hoge [root@hp-xw6400-02 ~]# cat /testdir_A/test1/testB This is testB [root@hp-xw6400-02 ~]# cat /testdir_samba_A/127.0.0.1/automounttest/sambaB This is sambaB 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-1079.html 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-1079.html |