Bug 801802 - when user lists directory containing symlink to automounted FS, the fs mounts
Summary: when user lists directory containing symlink to automounted FS, the fs mounts
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: autofs
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: beta
: 6.4
Assignee: Ian Kent
QA Contact: yanfu,wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-09 14:49 UTC by David Jaša
Modified: 2012-09-11 13:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-11 13:44:33 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description David Jaša 2012-03-09 14:49:42 UTC
Description of problem:
when user has a symlink that points to some location in automounted directories and lists the directory containing the link, the FS mounts even though it is not necessary.

This behaviour leads to long timeouts when e.g. the FS is not reachable

Version-Release number of selected component (if applicable):
autofs-5.0.5-39.el6_2.1.x86_64

How reproducible:
always

Steps to Reproduce:
1. verify that there are no autofs-managed filesystems mounted
2. create a symlink in /mnt to some auto-mounted directory:
ln -s /net/your_nfs_server_hostname/path /mnt/symlink
3. list /mnt directory:
ls /mnt
  
Actual results:
/net/your_nfs_server_hostname/path gets mounted

Expected results:
autofs doesn't try to mount the fs until 'ls /mnt/symlink' is called

Additional info:

Comment 1 Ian Kent 2012-03-11 05:35:52 UTC
(In reply to comment #0)
> Description of problem:
> when user has a symlink that points to some location in automounted directories
> and lists the directory containing the link, the FS mounts even though it is
> not necessary.
> 
> This behaviour leads to long timeouts when e.g. the FS is not reachable
> 
> Version-Release number of selected component (if applicable):
> autofs-5.0.5-39.el6_2.1.x86_64
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. verify that there are no autofs-managed filesystems mounted
> 2. create a symlink in /mnt to some auto-mounted directory:
> ln -s /net/your_nfs_server_hostname/path /mnt/symlink
> 3. list /mnt directory:
> ls /mnt
> 
> Actual results:
> /net/your_nfs_server_hostname/path gets mounted
> 
> Expected results:
> autofs doesn't try to mount the fs until 'ls /mnt/symlink' is called

Basically, that's not possible.

But see bug 787595 for an discussion of why the perceived behaviour
has changed.

I suspect we will be closing this as a duplicate once you have.

Comment 2 Ian Kent 2012-03-11 05:43:54 UTC
btw, to discuss this further you'll need to provide kernel
version too since there are small differences between recent
kernels.

Comment 3 David Jaša 2012-03-12 08:54:38 UTC
(In reply to comment #2)
> btw, to discuss this further you'll need to provide kernel
> version too since there are small differences between recent
> kernels.

I noticed this behaviour on 6.2+ kernels, I'm not sure about behaviours of previous kernels. Now I'm running 6.3 nightly with:
2.6.32-244.el6.x86_64

Comment 4 Ian Kent 2012-03-12 09:33:56 UTC
There were kernels where stat(2) would trigger a mount, see
bug bug 745775 for patches which (should have) changed this.

The last time I looked at this (bug 787595) colour ls did an
lstat(2) followed by a readlink(2) and looking at the kernel
code I believed that the readlink(2) call would trigger a
mount. Looking again just now it looks like it won't so
for kernel revision 238 and later this shouldn't happen.
What's even more puzzling is that testing with an older
kernel without any of these changes the symlink mount
also occurred.

I'll have to continue looking.
An strace of your command and maps used will help with this.

Comment 5 RHEL Program Management 2012-07-10 06:49:09 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-10 23:05:27 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 7 Ian Kent 2012-09-11 05:51:00 UTC
(In reply to comment #4)
> There were kernels where stat(2) would trigger a mount, see
> bug bug 745775 for patches which (should have) changed this.
> 
> The last time I looked at this (bug 787595) colour ls did an
> lstat(2) followed by a readlink(2) and looking at the kernel
> code I believed that the readlink(2) call would trigger a
> mount. Looking again just now it looks like it won't so
> for kernel revision 238 and later this shouldn't happen.
> What's even more puzzling is that testing with an older
> kernel without any of these changes the symlink mount
> also occurred.
> 
> I'll have to continue looking.
> An strace of your command and maps used will help with this.

From RHEL-6.3 the automount behaviour is the same as it previously
was and the same as upstream.

Accessing a symlink as described here will cause the automount to
be mounted unless the browse option is used. This has always been
the way this has behaved.

The request here amounts to, in some way, be able to behave
in two different ways within the kernel for the exact same
system call. It just isn't possible.

You can use the browse option to prevent the mounting and it
is worth you investiating its use. We recommend against using
this option for large indirect maps due to possible performace
impact.

I think this bug needs to be closed as CANTFIX.

Note that there has been quite a bit of work put into improving
interacive response when unavailable servers are encountered.
That change was needed due the changes in nfs-utils not autofs.

Ian

Comment 8 Ric Wheeler 2012-09-11 13:44:33 UTC
Closing per Ian's comment above. We can reopen if you disagree.

Thanks!


Note You need to log in before you can comment on or make changes to this bug.