All of lore.kernel.org
 help / color / mirror / Atom feed
* autofs not mounting directories
@ 2004-03-16  3:58 Noel Hunt
  2004-03-17  3:24 ` Ian Kent
  0 siblings, 1 reply; 12+ messages in thread
From: Noel Hunt @ 2004-03-16  3:58 UTC (permalink / raw)
  To: autofs mailing list

I have been given reports by users that after a reboot,
cron jobs don't run, and also sudo su - ..., while not
failing, is not cd'ing to the user's home directory. In
the cron case, there were commands of the form

/a/b/cmd > /a/b/log 2>&1

(/a/b being an automount point) where one would expect
the modify time of /a/b/log to change even if the command
fails, but the files modification times were unchanged from
the last access.

I was also told that a cd from the shell to the directory
in question solves the problem.

The machines on which this is reported had no cron logging
which I have now remedied, so I can't try to reproduce this
until I can reboot these machines.

If `directory' is an automount mountpoint, is there some
difference between `cd directory', and say cron running
`/directory/bin/cmd', in the way that `directory' is
accessed? I understand the former will cause a chdir()
which will invoke autofs_root_lookup(); in the latter case,
I don't know what goes on.

Noel Hunt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-16  3:58 autofs not mounting directories Noel Hunt
@ 2004-03-17  3:24 ` Ian Kent
  2004-03-17 20:48   ` Robert Au
  2004-03-19  2:00   ` mmarion
  0 siblings, 2 replies; 12+ messages in thread
From: Ian Kent @ 2004-03-17  3:24 UTC (permalink / raw)
  To: Noel Hunt; +Cc: autofs mailing list

On Tue, 16 Mar 2004, Noel Hunt wrote:

> 
> If `directory' is an automount mountpoint, is there some
> difference between `cd directory', and say cron running
> `/directory/bin/cmd', in the way that `directory' is
> accessed? I understand the former will cause a chdir()
> which will invoke autofs_root_lookup(); in the latter case,
> I don't know what goes on.

Yes.

Sounds like you may be suffering from the same problem that was reported 
by Michael Blandford. I'm mystified I haven't seen the problem before as 
it is so fundamental to proper operation.

I'll be looking to get a test group together from the list in a couple of 
days.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-17  3:24 ` Ian Kent
@ 2004-03-17 20:48   ` Robert Au
  2004-03-17 22:04     ` Michael Blandford
  2004-03-18  1:30     ` Ian Kent
  2004-03-19  2:00   ` mmarion
  1 sibling, 2 replies; 12+ messages in thread
From: Robert Au @ 2004-03-17 20:48 UTC (permalink / raw)
  To: autofs

On Wed, Mar 17, 2004 at 11:24:36AM +0800, Ian Kent wrote:
> On Tue, 16 Mar 2004, Noel Hunt wrote:
> > If `directory' is an automount mountpoint, is there some
> > difference between `cd directory', and say cron running
> > `/directory/bin/cmd', in the way that `directory' is
> > accessed? I understand the former will cause a chdir()
> > which will invoke autofs_root_lookup(); in the latter case,
> > I don't know what goes on.
> 
> Yes.
> 
> Sounds like you may be suffering from the same problem that was reported 
> by Michael Blandford. I'm mystified I haven't seen the problem before as 
> it is so fundamental to proper operation.

I don't see Michael's original report in the list archives. Did he send it
to the list?
 
> I'll be looking to get a test group together from the list in a couple of 
> days.

I think we are seeing something similar here; sporadically, listing a file
with ls will fail until a process changes working directory to that file's
directory. I'd like to help out in the testing. We are seeing this problem
with Red Hat 7.2 (kernel 2.4.7-10), autofs 4.1.0, and kernel module
autofs4-2.4-module-20031201.

-- 
Robert Au                     rau@lsil.com
                              LSI Logic

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-17 20:48   ` Robert Au
@ 2004-03-17 22:04     ` Michael Blandford
  2004-03-18  1:30     ` Ian Kent
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Blandford @ 2004-03-17 22:04 UTC (permalink / raw)
  To: Robert Au; +Cc: autofs

Robert Au wrote:

>I think we are seeing something similar here; sporadically, listing a file
>with ls will fail until a process changes working directory to that file's
>directory. I'd like to help out in the testing. We are seeing this problem
>with Red Hat 7.2 (kernel 2.4.7-10), autofs 4.1.0, and kernel module
>autofs4-2.4-module-20031201.
>  
>
I could replicate the problem by cd'ing into a directory ( that caused 
it to get automounted ) and try to touch a file.  It would fail.  cd out 
of the directory and back in and it would now work.  I only see this 
problem on 4.1.x.

Michael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-17 20:48   ` Robert Au
  2004-03-17 22:04     ` Michael Blandford
@ 2004-03-18  1:30     ` Ian Kent
  2004-03-18  5:26       ` Michael Blandford
  1 sibling, 1 reply; 12+ messages in thread
From: Ian Kent @ 2004-03-18  1:30 UTC (permalink / raw)
  To: Robert Au; +Cc: autofs

On Wed, 17 Mar 2004, Robert Au wrote:

> > 
> > Sounds like you may be suffering from the same problem that was reported 
> > by Michael Blandford. I'm mystified I haven't seen the problem before as 
> > it is so fundamental to proper operation.
> 
> I don't see Michael's original report in the list archives. Did he send it
> to the list?

No.

It was reported when he was testing changes he had requested for 4.1.1. 

>  
> > I'll be looking to get a test group together from the list in a couple of 
> > days.
> 
> I think we are seeing something similar here; sporadically, listing a file
> with ls will fail until a process changes working directory to that file's
> directory. I'd like to help out in the testing. We are seeing this problem
> with Red Hat 7.2 (kernel 2.4.7-10), autofs 4.1.0, and kernel module
> autofs4-2.4-module-20031201.

2.4.7. I wonder if the patch I'm creating against 2.4.20 will work for 
you.

Strange this has gone un-noticed for over 18 months and then suddenly 
reports are popping up everywhere. Maybe it's just the focus at the moment 
so everything seems to be caused by it.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18  1:30     ` Ian Kent
@ 2004-03-18  5:26       ` Michael Blandford
  2004-03-18  6:47         ` Ian Kent
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Blandford @ 2004-03-18  5:26 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs

Ian Kent wrote:

>2.4.7. I wonder if the patch I'm creating against 2.4.20 will work for 
>you.
>
>Strange this has gone un-noticed for over 18 months and then suddenly 
>reports are popping up everywhere. Maybe it's just the focus at the moment 
>so everything seems to be caused by it.
>  
>

After we get it fixed for 2.4.20, I will take a stab at backporting it 
to 2.4.9 which will probably be close enough for 2.4.7

Michael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18  5:26       ` Michael Blandford
@ 2004-03-18  6:47         ` Ian Kent
  2004-03-18  6:57           ` Noel Hunt
  2004-03-18 17:34           ` Jim Carter
  0 siblings, 2 replies; 12+ messages in thread
From: Ian Kent @ 2004-03-18  6:47 UTC (permalink / raw)
  To: Michael Blandford; +Cc: autofs

On Wed, 17 Mar 2004, Michael Blandford wrote:

> Ian Kent wrote:
> 
> >2.4.7. I wonder if the patch I'm creating against 2.4.20 will work for 
> >you.
> >
> >Strange this has gone un-noticed for over 18 months and then suddenly 
> >reports are popping up everywhere. Maybe it's just the focus at the moment 
> >so everything seems to be caused by it.
> >  
> >
> 
> After we get it fixed for 2.4.20, I will take a stab at backporting it 
> to 2.4.9 which will probably be close enough for 2.4.7
> 

Shouldn't be to bad. It needed practically no changes until about 2.4.18 
or 20.

I may have the patch done tonight.

One consequence of this is that when cd'ing to a directory we will have to 
trigger the mount. To do it any other way will mean, essentially, 
rewriting autofs4 from the ground up. Maybe not a bad idea, but not now.
At least that is my impression atm.


Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18  6:47         ` Ian Kent
@ 2004-03-18  6:57           ` Noel Hunt
  2004-03-19  1:08             ` Ian Kent
  2004-03-18 17:34           ` Jim Carter
  1 sibling, 1 reply; 12+ messages in thread
From: Noel Hunt @ 2004-03-18  6:57 UTC (permalink / raw)
  To: autofs

> One consequence of this is that when cd'ing to a directory we will have to 
> trigger the mount.

Isn't this the normal behaviour?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18  6:47         ` Ian Kent
  2004-03-18  6:57           ` Noel Hunt
@ 2004-03-18 17:34           ` Jim Carter
  2004-03-19  1:04             ` Ian Kent
  1 sibling, 1 reply; 12+ messages in thread
From: Jim Carter @ 2004-03-18 17:34 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs, Michael Blandford

On Thu, 18 Mar 2004, Ian Kent wrote:
> One consequence of this is that when cd'ing to a directory we will have to 
> trigger the mount. To do it any other way will mean, essentially, 
> rewriting autofs4 from the ground up....

Am I missing something here?  If your process "cd"s to a directory, you
aren't changing to the mount point, you're changing to the referent.  That
is only allowed if you have X permission, and the only way the local kernel
can know that is to first mount the referent, and subsequently stat the
mount-root.

So it doesn't bother me that "cd" triggers mounting, even though in 0.1% of
the cases the process might "cd" elsewhere immediately without looking at
any files within the mount-root.  In most cases the very next system call
will be either to list the directory content or to open a file already
known to be in that directory, using a relative path.  So the mount is
hardly ever wasted.

I wonder if "cd"ing to the mount point, then mounting something over it, 
might trigger subtle bugs.  Example: the (nonexistent) content of the mount 
point dir is cached, and when you enumerate the directory you get the 
cached nothingness rather than the content of the referent, which you 
aren't even "cd"d to.   Hmmm, does this sound familiar?

James F. Carter          Voice 310 825 2897    FAX 310 206 6673
UCLA-Mathnet;  6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA  90095-1555
Email: jimc@math.ucla.edu    http://www.math.ucla.edu/~jimc (q.v. for PGP key)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18 17:34           ` Jim Carter
@ 2004-03-19  1:04             ` Ian Kent
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Kent @ 2004-03-19  1:04 UTC (permalink / raw)
  To: Jim Carter; +Cc: autofs, Michael Blandford

On Thu, 18 Mar 2004, Jim Carter wrote:

> On Thu, 18 Mar 2004, Ian Kent wrote:
> > One consequence of this is that when cd'ing to a directory we will have to 
> > trigger the mount. To do it any other way will mean, essentially, 
> > rewriting autofs4 from the ground up....
> 
> Am I missing something here?  If your process "cd"s to a directory, you
> aren't changing to the mount point, you're changing to the referent.  That
> is only allowed if you have X permission, and the only way the local kernel
> can know that is to first mount the referent, and subsequently stat the
> mount-root.
> 
> So it doesn't bother me that "cd" triggers mounting, even though in 0.1% of
> the cases the process might "cd" elsewhere immediately without looking at
> any files within the mount-root.  In most cases the very next system call
> will be either to list the directory content or to open a file already
> known to be in that directory, using a relative path.  So the mount is
> hardly ever wasted.

Yes. It seemed like a fair policy to me.

I've stubonly resisted changing anything outside of the autofs4 module but 
in this case the increase in complexity for the module, if it can be done 
at all, is not worth it.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-18  6:57           ` Noel Hunt
@ 2004-03-19  1:08             ` Ian Kent
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Kent @ 2004-03-19  1:08 UTC (permalink / raw)
  To: Noel Hunt; +Cc: autofs

On Thu, 18 Mar 2004, Noel Hunt wrote:

> > One consequence of this is that when cd'ing to a directory we will have to 
> > trigger the mount.
> 
> Isn't this the normal behaviour?

Not previously.

Check my reply to Jim Carter for my comment on this.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: autofs not mounting directories
  2004-03-17  3:24 ` Ian Kent
  2004-03-17 20:48   ` Robert Au
@ 2004-03-19  2:00   ` mmarion
  1 sibling, 0 replies; 12+ messages in thread
From: mmarion @ 2004-03-19  2:00 UTC (permalink / raw)
  To: autofs

On 17 Mar, Ian Kent wrote:

> Sounds like you may be suffering from the same problem that was reported 
> by Michael Blandford. I'm mystified I haven't seen the problem before as 
> it is so fundamental to proper operation.

Reading over this thread, it sounds like it might be related to something we
patched for a long time ago (way before you took over).  Jim Barbour here at
Qualcomm figured out a one line patch that fixed similar issues we were having
with our program map mounted trees.  He sent it to the old list way back in 
early '01 and noone seemed to care then.  

I still have to add this one line in for our direct maps (via program) to
work:

*** autofs-4.1.1-orig/daemon/automount.c	Thu Jan 29 08:01:22 2004
--- autofs-4.1.1/daemon/automount.c	Fri Mar  5 12:57:47 2004
***************
*** 1066,1071 ****
--- 1066,1072 ----
  			close(ap.ioctlfd);
  			close(ap.state_pipe[0]);
  			close(ap.state_pipe[1]);
+ 			chdir(ap.path);
  
  			err = ap.lookup->lookup_mount(ap.path,
  						      pkt->name, pkt->len,

This is the pre-release 4.1.1 btw.. in case it's slightly different in the
official 4.1.1.

-- 
Mike Marion-Unix SysAdmin/Staff Engineer-http://www.qualcomm.com
Alcohol and Calculus don't mix. Never drink and derive.
==> Another /. gem

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-03-19  2:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16  3:58 autofs not mounting directories Noel Hunt
2004-03-17  3:24 ` Ian Kent
2004-03-17 20:48   ` Robert Au
2004-03-17 22:04     ` Michael Blandford
2004-03-18  1:30     ` Ian Kent
2004-03-18  5:26       ` Michael Blandford
2004-03-18  6:47         ` Ian Kent
2004-03-18  6:57           ` Noel Hunt
2004-03-19  1:08             ` Ian Kent
2004-03-18 17:34           ` Jim Carter
2004-03-19  1:04             ` Ian Kent
2004-03-19  2:00   ` mmarion

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.