Bug 1371793 - Unable to use autofs to automatically mount paths on my stackable fs when the paths are accesssed
Summary: Unable to use autofs to automatically mount paths on my stackable fs when the...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: autofs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: xiaoli feng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-31 06:43 UTC by hkaur
Modified: 2017-12-06 12:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 12:43:16 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1371796 0 unspecified CLOSED Unable to un-mount paths from my stackable fs using timeout option in autofs 2021-02-22 00:41:40 UTC

Description hkaur 2016-08-31 06:43:24 UTC
I am trying to use autofs to automatically mount paths on my stackable fs when they are accessed but I am unable to do that.
I normally use my <custom> application to mount/unmount paths.

The last logs that I see for automount are < from autofs source code >  -
automount[4241]: do_mount: /1 /1 type <custom>fs options  using module generic
automount[4241]: mount_mount: mount(generic): calling mkdir_path /1
automount[4241]: mount_mount: mount(generic): calling mount -t <custom>fs /1 /1

Let's assume that /1 is the path that I am trying to mount on my stackable fs.

But I have seen that on removing '--disable-mount-locking' flag from '%configure --disable-mount-locking --enable-ignore-busy --with-libtirpc', present in the autofs.spec file and building the autofs rpm again, autofs is able to mount paths on my stackable fs. 

What is the significance of this flag, --disable-mount-locking and how can I handle it my end in custom application? 

Thanks

Comment 2 Ian Kent 2016-09-02 03:37:02 UTC
(In reply to hkaur from comment #0)
> I am trying to use autofs to automatically mount paths on my stackable fs
> when they are accessed but I am unable to do that.
> I normally use my <custom> application to mount/unmount paths.
> 
> The last logs that I see for automount are < from autofs source code >  -
> automount[4241]: do_mount: /1 /1 type <custom>fs options  using module
> generic
> automount[4241]: mount_mount: mount(generic): calling mkdir_path /1
> automount[4241]: mount_mount: mount(generic): calling mount -t <custom>fs /1
> /1
> 
> Let's assume that /1 is the path that I am trying to mount on my stackable
> fs.
> 
> But I have seen that on removing '--disable-mount-locking' flag from
> '%configure --disable-mount-locking --enable-ignore-busy --with-libtirpc',
> present in the autofs.spec file and building the autofs rpm again, autofs is
> able to mount paths on my stackable fs. 
> 
> What is the significance of this flag, --disable-mount-locking and how can I
> handle it my end in custom application? 

That configure flag is supposed to tell autofs to not take a mutex
over when executing mount(8) and that's all.

I don't see how that could make a difference to what you are trying
to do but I'll have a look.

As I have said before, the way you describe this it looks like it
cannot work so there must be more to this than you describe.

Comment 3 Ian Kent 2016-09-02 08:50:03 UTC
(In reply to Ian Kent from comment #2)
> 
> That configure flag is supposed to tell autofs to not take a mutex
> over when executing mount(8) and that's all.
> 
> I don't see how that could make a difference to what you are trying
> to do but I'll have a look.

I had a look at this to check if perhaps the meaning of the
configure option was inverted.

Apart from the comment text in the generated config.h being
misleading the option appears to do what it is supposed to
do, at least from the POV of the rpm build.

So, FWICS a mutex is not taken during the mount operation.

The taking of a mutex during mount(8) execution is meant to
prevent corruption of the text based /etc/mtab. It isn't
effective since other applications can concurrently access
the mount table but autofs can perform largish numbers of
mounts rapidly and so if relevant in that respect.

The mtab corruption hadn't been seen for quite a while when
this option was added.

It also allows the mount location path (the thing being
mounted) to refer indirectly to other autofs mounts in the
same map (otherwise taking the lock will make automount(8)
hang).

Apart from what appears to be an invalid direct map entry
above what you describe sounds like the logic of this option
is inverted so I'm puzzled now, firstly about how this can
work at all and also how removing the option could make this
invalid entry work ok.

You'll need to convince me, a full debug log of this working
in a real world setup would be a good start.

Also, a copy of include/config.h from the build directory of
the working rpm would be informative.

Comment 4 Ian Kent 2016-09-02 09:15:44 UTC
(In reply to Ian Kent from comment #3)
> 
> It also allows the mount location path (the thing being
> mounted) to refer indirectly to other autofs mounts in the
> same map (otherwise taking the lock will make automount(8)
> hang).

Actually that's not correct.

The mutex is a static global variable within the module that
executes mount commands so if locking is enabled any mount
location path that itself refers to an automounted directory
will deadlock automount(8).

Comment 7 Jan Kurik 2017-12-06 12:43:16 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


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