Bug 758466

Summary: gvfsd-trash keeps NFS automounts for other users mounted
Product: Red Hat Enterprise Linux 6 Reporter: David Anderson <danders5>
Component: gvfsAssignee: Ondrej Holy <oholy>
Status: CLOSED DUPLICATE QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: mussulma, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-02 10:35:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Anderson 2011-11-29 21:14:12 UTC
Description of problem:
We have a large remote desktop linux server with FreeNX and 100s of active users.   We use a autofs /home where /home/user is a autmount point. gvfsd-trash seems to lock onto mounted filesystems including NFS ones under automount and continually check them until the user logs off the system.


Problem is with hundreds of users logging in and out for varying periods of time, we end up over time with a growing number of NFS mounts, IE 140 users active but 600 mounted filesystems because gvfsd-trash keeps making automount remount expired filesystems, and unless all users log off for a period of time the mounts never reduce.  

Version-Release number of selected component (if applicable):
gvfs-1.4.3-12.el6.x86_64
autofs-5.0.5-31.el6.x86_64


How reproducible:
log in two users, at least one through GNOME and log off the non gnome user and wait for the automounted home to expire.   it is easiest to use debug logging in autofs to see it.

Steps to Reproduce:
1. setup automounted home directories where each user mounts its own nfs home
2. login two or more users using gnome/freenx etc should also work with console and ssh.
3. logoff all but the console/gnome login
4. watch autofs logs and see that the process calling for mount of old home directories is the gvfsd-trash process for a entirely different user.
  
Actual results:

Here is an excerpt from my system logs after reproducing this issue.

Nov 29 14:37:13 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /-
Nov 29 14:37:19 linux4 automount[14526]: st_expire: state 1 path /home
Nov 29 14:37:19 linux4 automount[14526]: expire_proc: exp_proc = 140125209908992 path /home
Nov 29 14:37:19 linux4 automount[14526]: expire_proc_indirect: expire /home/mussulma
Nov 29 14:37:19 linux4 automount[14526]: expire_proc_indirect: expire /home/danders5
Nov 29 14:37:19 linux4 automount[14526]: 2 remaining in /home
Nov 29 14:37:19 linux4 automount[14526]: expire_cleanup: got thid 140125209908992 path /home stat 5
Nov 29 14:37:19 linux4 automount[14526]: expire_cleanup: sigchld: exp 140125209908992 finished, switching from 2 to 1
Nov 29 14:37:19 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /home
Nov 29 14:37:47 linux4 automount[14526]: st_expire: state 1 path /class
Nov 29 14:37:47 linux4 automount[14526]: expire_proc: exp_proc = 140125209908992 path /class
Nov 29 14:37:47 linux4 automount[14526]: expire_cleanup: got thid 140125209908992 path /class stat 0
Nov 29 14:37:47 linux4 automount[14526]: expire_cleanup: sigchld: exp 140125209908992 finished, switching from 2 to 1
Nov 29 14:37:47 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /class
Nov 29 14:37:57 linux4 automount[14526]: st_expire: state 1 path /data
Nov 29 14:37:57 linux4 automount[14526]: expire_proc: exp_proc = 140125209908992 path /data
Nov 29 14:37:57 linux4 automount[14526]: expire_cleanup: got thid 140125209908992 path /data stat 0
Nov 29 14:37:57 linux4 automount[14526]: expire_cleanup: sigchld: exp 140125209908992 finished, switching from 2 to 1
Nov 29 14:37:57 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /data
Nov 29 14:38:28 linux4 automount[14526]: st_expire: state 1 path /-
Nov 29 14:38:28 linux4 automount[14526]: expire_proc: exp_proc = 140125209908992 path /-
Nov 29 14:38:28 linux4 automount[14526]: expire_proc_direct: send expire to trigger /scratch
Nov 29 14:38:28 linux4 automount[14526]: 1 remaining in /-
Nov 29 14:38:28 linux4 automount[14526]: expire_cleanup: got thid 140125209908992 path /- stat 1
Nov 29 14:38:28 linux4 automount[14526]: expire_cleanup: sigchld: exp 140125209908992 finished, switching from 2 to 1
Nov 29 14:38:28 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /-
Nov 29 14:38:34 linux4 automount[14526]: st_expire: state 1 path /home
Nov 29 14:38:34 linux4 automount[14526]: expire_proc: exp_proc = 140125209908992 path /home
Nov 29 14:38:34 linux4 automount[14526]: expire_proc_indirect: expire /home/mussulma
Nov 29 14:38:34 linux4 automount[14526]: handle_packet: type = 4
Nov 29 14:38:34 linux4 automount[14526]: handle_packet_expire_indirect: token 61, name mussulma
Nov 29 14:38:34 linux4 automount[14526]: expiring path /home/mussulma
Nov 29 14:38:34 linux4 automount[14526]: umount_multi: path /home/mussulma incl 1
Nov 29 14:38:34 linux4 automount[14526]: unmounting dir = /home/mussulma
Nov 29 14:38:34 linux4 automount[14526]: spawn_umount: mtab link detected, passing -n to mount
Nov 29 14:38:34 linux4 automount[14526]: rm_unwanted_fn: removing directory /home/mussulma
Nov 29 14:38:34 linux4 automount[14526]: expired /home/mussulma
Nov 29 14:38:34 linux4 automount[14526]: dev_ioctl_send_ready: token = 61
Nov 29 14:38:34 linux4 automount[14526]: expire_proc_indirect: expire /home/danders5
Nov 29 14:38:34 linux4 automount[14526]: 1 remaining in /home
Nov 29 14:38:34 linux4 automount[14526]: expire_cleanup: got thid 140125209908992 path /home stat 4
Nov 29 14:38:34 linux4 automount[14526]: expire_cleanup: sigchld: exp 140125209908992 finished, switching from 2 to 1
Nov 29 14:38:34 linux4 automount[14526]: st_ready: st_ready(): state = 2 path /home
Nov 29 14:38:36 linux4 automount[14526]: handle_packet: type = 3
Nov 29 14:38:36 linux4 automount[14526]: handle_packet_missing_indirect: token 62, name mussulma, request pid 4754
Nov 29 14:38:36 linux4 automount[14526]: attempting to mount entry /home/mussulma
Nov 29 14:38:36 linux4 automount[14526]: lookup_mount: lookup(program): mussulma -> -fstype=nfs,hard,intr,tcp,noacl,acregmin=30,vers=3 homes.ews.illinois.edu:/ews/engr/mussulma
Nov 29 14:38:36 linux4 automount[14526]: lookup_mount: lookup(program): looking up mussulma
Nov 29 14:38:36 linux4 automount[14526]: lookup_mount: lookup(program): mussulma -> -fstype=nfs,hard,intr,tcp,noacl,acregmin=30,vers=3 homes.ews.illinois.edu:/ews/engr/mussulma
Nov 29 14:38:36 linux4 automount[14526]: parse_mount: parse(sun): expanded entry: -fstype=nfs,hard,intr,tcp,noacl,acregmin=30,vers=3 homes.ews.illinois.edu:/ews/engr/mussulma
Nov 29 14:38:36 linux4 automount[14526]: parse_mount: parse(sun): gathered options: -n,fstype=nfs,hard,intr,tcp,noacl,acregmin=30,vers=3
Nov 29 14:38:36 linux4 automount[14526]: parse_mount: parse(sun): dequote("homes.ews.illinois.edu:/ews/engr/mussulma") -> homes.ews.illinois.edu:/ews/engr/mussulma
Nov 29 14:38:36 linux4 automount[14526]: parse_mount: parse(sun): core of entry: options=-n,fstype=nfs,hard,intr,tcp,noacl,acregmin=30,vers=3, loc=homes.ews.illinois.edu:/ews/engr/mussulma
Nov 29 14:38:36 linux4 automount[14526]: sun_mount: parse(sun): mounting root /home, mountpoint mussulma, what homes.ews.illinois.edu:/ews/engr/mussulma, fstype nfs, options -n,hard,intr,tcp,noacl,acregmin=30,vers=3
Nov 29 14:38:36 linux4 automount[14526]: mount_mount: mount(nfs): root=/home name=mussulma what=homes.ews.illinois.edu:/ews/engr/mussulma, fstype=nfs, options=-n,hard,intr,tcp,noacl,acregmin=30,vers=3
Nov 29 14:38:36 linux4 automount[14526]: mount_mount: mount(nfs): nfs options="-n,hard,intr,tcp,noacl,acregmin=30,vers=3", nosymlink=0, ro=0
Nov 29 14:38:36 linux4 automount[14526]: mount_mount: mount(nfs): calling mkdir_path /home/mussulma
Nov 29 14:38:36 linux4 automount[14526]: mount_mount: mount(nfs): calling mount -t nfs -s -o -n,hard,intr,tcp,noacl,acregmin=30,vers=3 homes.ews.illinois.edu:/ews/engr/mussulma /home/mussulma
Nov 29 14:38:36 linux4 automount[14526]: spawn_mount: mtab link detected, passing -n to mount
Nov 29 14:38:36 linux4 automount[14526]: mount(nfs): mounted homes.ews.illinois.edu:/ews/engr/mussulma on /home/mussulma
Nov 29 14:38:36 linux4 automount[14526]: dev_ioctl_send_ready: token = 62
Nov 29 14:38:36 linux4 automount[14526]: mounted /home/mussulma

Here is the requesting pid

Nov 29 14:38:36 linux4 automount[14526]: handle_packet_missing_indirect: token 62, name mussulma, request pid 4754

Which when I lookup with ps is a gvfsd-trash beloging to my user and not the mussulma user.

danders5 4754 1 0 14:24 ? 00:00:00 /usr/libexec/gvfsd-trash --spawner :1.6 /org/gtk/gvfs/exec_spaw/1


This is not such a major problem in a desktop environment, but on a large multiuser machine it is a crippling issue as it severely overtaxes automount with  many filesystems, and seems to do alot of mount/unmounts in certain cases as well.

Comment 3 Suzanne Logcher 2012-02-14 23:21:57 UTC
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. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 Ondrej Holy 2014-10-02 10:35:51 UTC

*** This bug has been marked as a duplicate of bug 998061 ***