Comment 79 for bug 769927

Revision history for this message
In , Jeff (jeff-redhat-bugs) wrote :

Created attachment 504121
debug patch -- instrument nfs_d_automount

Taking Ian's suggestion on IRC into account, I decided to instrument nfs_d_automount. I turned all of the dprintk's into printk's, had them print current->pid. I also added a printk of the string representation of the struct path.

It looks like we do have 2 concurrent nfs_d_automount requests going on here. They both return different vfsmounts, though. The second vfsmount does not show up in the mount table (as shown by crash's mount command). Here's the snippet of dmesg when I did the reproducer to trigger a mount. Unfortunately, the dump_stack() got a little muddled, but it gives you an idea of what's going on...

[ 214.444300] 1670: --> nfs_d_automount()
[ 214.445701] Pid: 1670, comm: claws-mail Not tainted 2.6.39-1.fc16.x86_64.debug #1
[ 214.448353] Call Trace:
[ 214.449301] [<ffffffffa01dc897>] nfs_d_automount+0x60/0x579 [nfs]
[ 214.451247] 1677: --> nfs_d_automount()
[ 214.451251] Pid: 1677, comm: claws-mail Not tainted 2.6.39-1.fc16.x86_64.debug #1
[ 214.451253] Call Trace:
[ 214.451279] [<ffffffffa01dc897>] nfs_d_automount+0x60/0x579 [nfs]
[ 214.451334] [<ffffffff814b9a15>] ? _raw_spin_unlock+0x28/0x2c
[ 214.451362] [<ffffffff811455b4>] ? dput+0xdc/0xfc
[ 214.451373] [<ffffffffa01cc347>] ? nfs_lookup_revalidate+0x227/0x366 [nfs]
[ 214.451377] [<ffffffff8113c463>] follow_managed+0x12a/0x1ce
[ 214.451381] [<ffffffff8113d7b8>] walk_component+0x22c/0x335
[ 214.451402] [<ffffffff81207715>] ? security_inode_exec_permission+0x25/0x27
[ 214.451406] [<ffffffff8113da60>] link_path_walk+0x19f/0x439
[ 214.451409] [<ffffffff8113de1e>] path_lookupat+0x5a/0x2e1
[ 214.451432] [<ffffffff81101170>] ? might_fault+0xa5/0xac
[ 214.451435] [<ffffffff81101127>] ? might_fault+0x5c/0xac
[ 214.451438] [<ffffffff8113c8ee>] ? getname_flags+0x31/0x1ca
[ 214.451441] [<ffffffff8113ef4f>] do_path_lookup+0x28/0x96
[ 214.451444] [<ffffffff8113f374>] user_path_at+0x59/0x96
[ 214.451462] [<ffffffff810774b6>] ? up_read+0x28/0x2c
[ 214.451471] [<ffffffff814bcf30>] ? do_page_fault+0x360/0x3b4
[ 214.451475] [<ffffffff8113703f>] vfs_fstatat+0x44/0x6e
[ 214.451478] [<ffffffff81101127>] ? might_fault+0x5c/0xac
[ 214.451481] [<ffffffff81137087>] vfs_lstat+0x1e/0x20
[ 214.451484] [<ffffffff811371d6>] sys_newlstat+0x1a/0x33
[ 214.451493] [<ffffffff810870f3>] ? trace_hardirqs_on_caller+0x10b/0x12f
[ 214.451502] [<ffffffff810a9e5f>] ? audit_syscall_entry+0x11c/0x148
[ 214.451523] [<ffffffff81256e1e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 214.451526] [<ffffffff814c05c2>] system_call_fastpath+0x16/0x1b
[ 214.451532] nfs_d_automount(1677): enter
[ 214.451548] 1677: dentry=ffff88001005c540 path=/misc/salusa/scratch
[ 214.471100] SELinux: initialized (dev 0:2b, type nfs4), uses genfs_contexts
[ 214.471587] nfs_d_automount(1677): done, success
[ 214.471607] 1677: <-- nfs_d_automount() = ffff88001194d140
[ 214.511636] [<ffffffff81078a0d>] ? sched_clock_local+0x12/0x75
[ 214.514001] [<ffffffff81083764>] ? trace_hardirqs_off+0xd/0xf
[ 214.515589] [<ffffffff81078bda>] ? local_clock+0x36/0x4d
[ 214.517049] [<ffffffff81083e91>] ? lock_release_holdtime.part.8+0x6b/0x72
[ 214.518857] [<ffffffff814b849f>] ? __mutex_unlock_slowpath+0x112/0x122
[ 214.521946] [<ffffffff8113c463>] follow_managed+0x12a/0x1ce
[ 214.523395] [<ffffffff8113d7b8>] walk_component+0x22c/0x335
[ 214.524896] [<ffffffff8113d956>] ? link_path_walk+0x95/0x439
[ 214.526307] [<ffffffff8113e4f0>] do_last+0x13f/0x5ad
[ 214.527571] [<ffffffff8113f4fe>] path_openat+0xcb/0x31f
[ 214.528964] [<ffffffff81078a0d>] ? sched_clock_local+0x12/0x75
[ 214.530742] [<ffffffff8113f78a>] do_filp_open+0x38/0x86
[ 214.532133] [<ffffffff814b9a15>] ? _raw_spin_unlock+0x28/0x2c
[ 214.533579] [<ffffffff8114a164>] ? alloc_fd+0x17f/0x191
[ 214.534965] [<ffffffff811327a0>] do_sys_open+0x6e/0x100
[ 214.536294] [<ffffffff810a9e5f>] ? audit_syscall_entry+0x11c/0x148
[ 214.537889] [<ffffffff81132852>] sys_open+0x20/0x22
[ 214.539129] [<ffffffff814c05c2>] system_call_fastpath+0x16/0x1b
[ 214.540601] nfs_d_automount(1670): enter
[ 214.541958] 1670: dentry=ffff88001005c540 path=/misc/salusa/scratch
[ 214.553643] nfs_d_automount(1670): done, success
[ 214.555077] 1670: <-- nfs_d_automount() = ffff88001194d280