Bug 1367576 - [RFE] Add browsing support into autofs for AMD format maps
Summary: [RFE] Add browsing support into autofs for AMD format maps
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs
Version: 7.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: xiaoli feng
Milan Navratil
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks: 1298243 1385242
TreeView+ depends on / blocked
 
Reported: 2016-08-16 20:30 UTC by Frank Hirtz
Modified: 2017-08-01 12:43 UTC (History)
5 users (show)

(edit)
*autofs* now supports the browse options of `amd` format maps

The browse functionality of sun format maps makes available automount points visible in directory listings of mounted automount-managed mounts and is now also available for *autofs* `amd` format maps.

You can now add mount point sections to the *autofs* configuration for `amd` format mounts, in the same way automount points are configured in `amd`, without the need to also add a corresponding entry to the master map. As a result, you can avoid having incompatible master map entries in the *autofs* master map within shared multi-vendor environments.

The "browsable_dirs" option can be used in either the *autofs* `[ amd ]` configuration section, or following `amd` mount point sections. The "browsable" and "utimeout" map options of amd type "auto" map entries can also be used.

Note that the "browsable_dirs" option can be set only to `yes` or `no`.
Clone Of:
(edit)
Last Closed: 2017-08-01 12:43:52 UTC


Attachments (Terms of Use)
Patch - fix short memory allocation in lookup_amd_instance() (1.02 KB, patch)
2016-08-17 02:30 UTC, Ian Kent
no flags Details | Diff
Patch - fix count_mounts() function (984 bytes, patch)
2016-08-17 02:31 UTC, Ian Kent
no flags Details | Diff
Patch - fix argc off by one in mount_autofs.c (1.33 KB, patch)
2016-08-17 02:32 UTC, Ian Kent
no flags Details | Diff
Patch - add ref counting to struct map_source (5.46 KB, patch)
2016-08-17 02:33 UTC, Ian Kent
no flags Details | Diff
Patch - add support for amd browsable option (7.32 KB, patch)
2016-08-17 02:35 UTC, Ian Kent
no flags Details | Diff
Patch - add ref counting to struct map_source (updated) (5.45 KB, patch)
2016-08-17 02:54 UTC, Ian Kent
no flags Details | Diff
Patch - fix typos in README.amd-maps (3.01 KB, patch)
2016-08-31 01:58 UTC, Ian Kent
no flags Details | Diff
Patch - add support for amd browsable option (updated) (10.29 KB, patch)
2016-08-31 01:59 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_map_name() (1.79 KB, patch)
2016-08-31 02:00 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_mount_paths() (2.87 KB, patch)
2016-08-31 02:01 UTC, Ian Kent
no flags Details | Diff
Patch - include amd mount section mounts in master mounts list (6.96 KB, patch)
2016-08-31 02:02 UTC, Ian Kent
no flags Details | Diff
Patch - add support for amd browsable option (update 2) (10.25 KB, patch)
2016-09-01 09:01 UTC, Ian Kent
no flags Details | Diff
Patch - include amd mount section mounts in master mounts list (updated) (6.96 KB, patch)
2016-09-01 09:02 UTC, Ian Kent
no flags Details | Diff
Patch - check for conflicting amd section mounts (3.00 KB, patch)
2016-09-01 09:03 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_map_name() (updated) (1.78 KB, patch)
2016-09-05 09:03 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_mount_paths() (updated) (2.89 KB, patch)
2016-09-05 09:04 UTC, Ian Kent
no flags Details | Diff
Patch - check for conflicting amd section mounts (updated) (3.31 KB, patch)
2016-09-05 09:06 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_get_map_options() (1.82 KB, patch)
2016-09-05 09:08 UTC, Ian Kent
no flags Details | Diff
Patch - capture cache option and its settings during parsing (2.70 KB, patch)
2016-09-05 09:09 UTC, Ian Kent
no flags Details | Diff
Patch - handle map_option cache for top level mounts (3.51 KB, patch)
2016-09-05 09:10 UTC, Ian Kent
no flags Details | Diff
Patch - handle amd cache option all in amd type auto mounts (4.30 KB, patch)
2016-09-05 09:11 UTC, Ian Kent
no flags Details | Diff
Patch - fix _strncmp() usage (2.04 KB, patch)
2017-03-16 09:43 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_map_name() (2.89 KB, patch)
2017-03-16 09:45 UTC, Ian Kent
no flags Details | Diff
Patch - add function conf_amd_get_map_options() (1.84 KB, patch)
2017-03-16 09:49 UTC, Ian Kent
no flags Details | Diff
Patch - handle map_option cache for top level mounts (updated) (3.86 KB, patch)
2017-03-16 09:53 UTC, Ian Kent
no flags Details | Diff
Patch - fix bogus check in expire_cleanup() (914 bytes, patch)
2017-03-16 09:56 UTC, Ian Kent
no flags Details | Diff
Patch - delay submount exit for amd submounts (1.83 KB, patch)
2017-03-16 09:57 UTC, Ian Kent
no flags Details | Diff
Patch - use autofs_point to store expire timeout where possibe (9.80 KB, patch)
2017-03-28 01:19 UTC, Ian Kent
no flags Details | Diff
Patch - fix possible NULL derefernce (1.36 KB, patch)
2017-03-30 08:22 UTC, Ian Kent
no flags Details | Diff
Patch - fix invalid reference in remount_active_mount() (1.14 KB, patch)
2017-04-23 23:59 UTC, Ian Kent
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2213 normal SHIPPED_LIVE autofs bug fix and enhancement update 2017-08-01 16:09:35 UTC

Description Frank Hirtz 2016-08-16 20:30:06 UTC
Description of problem:
We've discussed this with Ian, and the work's already in progress, but we wanted to formalize a request:

<snip>
Even though I don't yet have an RFE for this I have done some preliminary
evaluation of the request. Unfortunately for me the way I would like to do it
will add an unacceptable amount of complexity for insufficient benefit.

That means 2 things.

First, I'll need to do this within the existing browse framework in autofs.
While not ideal from my POV I don't have any choice and initial investigation
indicates the change is fairly straight forward doing it within the existing
browse framework.

Second, I will not be able to implement the amd "fullybrowsable" option for amd
format maps in autofs for the foreseeable future. AFAICS that option has limited
use apart from perhaps amd map debugging, also Richard doesn't need this
functionality, so that shouldn't be a problem.

Being that it looked fairly straight forward the investigation resulted in an
initial partial implementation
...
I have a start to that already but considering your environment I see another
problem that I'll need to fix. I'm thinking about how to do that as well as
contributing to the autofs discussion.

It will be necessary to check that the amd map format support will function
acceptably without the additional fix.
</snip>

This will require implementation and client validation for their map setup.

Version-Release number of selected component (if applicable):
RHEL7 autofs

Additional info:

This request came out of a discussion with Ian Kent and the client, so there's a bit of history on it.

Comment 1 Ian Kent 2016-08-17 02:30 UTC
Created attachment 1191452 [details]
Patch - fix short memory allocation in lookup_amd_instance()

Comment 2 Ian Kent 2016-08-17 02:31 UTC
Created attachment 1191453 [details]
Patch - fix count_mounts() function

Comment 3 Ian Kent 2016-08-17 02:32 UTC
Created attachment 1191454 [details]
Patch - fix argc off by one in mount_autofs.c

Comment 4 Ian Kent 2016-08-17 02:33 UTC
Created attachment 1191455 [details]
Patch - add ref counting to struct map_source

Comment 5 Ian Kent 2016-08-17 02:35 UTC
Created attachment 1191456 [details]
Patch - add support for amd browsable option

Comment 6 Ian Kent 2016-08-17 02:54 UTC
Created attachment 1191458 [details]
Patch - add ref counting to struct map_source (updated)

Fix patch description.

Comment 7 Ian Kent 2016-08-17 03:26:05 UTC
An initial test package with the above changes has been built.

It is located at:
http://people.redhat.com/ikent/autofs-5.0.7-56.bz1367576.2.el7/

We need to test there are not side effects of this change and
that the change works ok in the customer environment since the
scale of the customer environment is large.

I can help QE with test development for verification of the
required functionality.

Comment 8 Ian Kent 2016-08-17 03:34:05 UTC
(In reply to Frank Hirtz from comment #0)
> ...
> I have a start to that already but considering your environment I see another
> problem that I'll need to fix. I'm thinking about how to do that as well as
> contributing to the autofs discussion.

The problem that I was referring to above is related to the
frequent map reuse that is common in amd map configurations.

Given the size of the maps that will be used here the lack
of map reuse would have been a significant problem but I
believe it is addressed by the patch that adds reference
counting to the top level map source structure.

We will need to see if this is sufficient and watch out for
side effects of this particular change.

Comment 12 Ian Kent 2016-08-31 01:58 UTC
Created attachment 1196135 [details]
Patch - fix typos in README.amd-maps

Comment 13 Ian Kent 2016-08-31 01:59 UTC
Created attachment 1196136 [details]
Patch - add support for amd browsable option (updated)

Add documentation and man page changes.

Comment 14 Ian Kent 2016-08-31 02:00 UTC
Created attachment 1196137 [details]
Patch - add function conf_amd_get_map_name()

Comment 15 Ian Kent 2016-08-31 02:01 UTC
Created attachment 1196138 [details]
Patch - add function conf_amd_get_mount_paths()

Comment 16 Ian Kent 2016-08-31 02:02 UTC
Created attachment 1196139 [details]
Patch - include amd mount section mounts in master mounts list

Comment 17 Ian Kent 2016-08-31 02:08:41 UTC
An updated test package with the above changes has been built.

It is located at:
http://people.redhat.com/ikent/autofs-5.0.7-56.bz1367576.3.el7/

This package adds the ability of autofs to use top level amd
mount sections of the autofs configuration instead of requiring
an additional master map entry.

Please give this a try and let us know how it goes.

Comment 18 Ian Kent 2016-09-01 09:01 UTC
Created attachment 1196643 [details]
Patch - add support for amd browsable option (update 2)

Remove debug log statement.

Comment 19 Ian Kent 2016-09-01 09:02 UTC
Created attachment 1196644 [details]
Patch - include amd mount section mounts in master mounts list (updated)

Fix CHANGELOG text.

Comment 20 Ian Kent 2016-09-01 09:03 UTC
Created attachment 1196645 [details]
Patch - check for conflicting amd section mounts

Comment 21 Ian Kent 2016-09-01 09:37:32 UTC
An updated test package with the above changes has been built.

It is located at:
http://people.redhat.com/ikent/autofs-5.0.7-56.bz1367576.4.el7/

This package adds a check for amd section mounts that conflict
with entries in the master map and includes a couple of other
minor updates to existing patches.

It would be good if this package could be tested, I need to know
if this functions in the customer environment and to find out
what else I need to fix.

Comment 22 Ian Kent 2016-09-05 09:03 UTC
Created attachment 1197821 [details]
Patch - add function conf_amd_get_map_name() (updated)

- fix typo in patch description.

Comment 23 Ian Kent 2016-09-05 09:04 UTC
Created attachment 1197822 [details]
Patch - add function conf_amd_get_mount_paths() (updated)

- fix initialization mistake in conf_enumerate_amd_mount_sections().

Comment 24 Ian Kent 2016-09-05 09:06 UTC
Created attachment 1197823 [details]
Patch - check for conflicting amd section mounts (updated)

- fix path not applied.
- update patch to check for existing amd master map entry and
  not issue message.

Comment 25 Ian Kent 2016-09-05 09:08 UTC
Created attachment 1197824 [details]
Patch - add function conf_get_map_options()

Comment 26 Ian Kent 2016-09-05 09:09 UTC
Created attachment 1197825 [details]
Patch - capture cache option and its settings during parsing

Comment 27 Ian Kent 2016-09-05 09:10 UTC
Created attachment 1197826 [details]
Patch - handle map_option cache for top level mounts

Comment 28 Ian Kent 2016-09-05 09:11 UTC
Created attachment 1197827 [details]
Patch - handle amd cache option all in amd type auto mounts

Comment 29 Ian Kent 2016-09-05 09:31:08 UTC
An updated test package with the above changes has been built.

It is located at:
http://people.redhat.com/ikent/autofs-5.0.7-56.bz1367576.5.el7/

Changes since revision 4:
- fix typo in description of add function conf_amd_get_map_name()
  patch.
- fix initialization mistake in conf_enumerate_amd_mount_sections().
- fix patch not applied and update check for existing amd master map
  entry.
- add handling of amd cache option for top level and type auto
  mounts.

Please test this build.

Comment 30 Mark Thacker 2016-11-23 17:32:40 UTC
Adding pm_ack to this and placing it on the RHEL 7.4 Filesystems and Storage RPL

Comment 32 Dave Wysochanski 2016-11-28 22:09:42 UTC
As far as I know moving forward with this bug depends on feedback from the latest autofs test package per https://bugzilla.redhat.com/show_bug.cgi?id=1367576#c29

Comment 36 Ian Kent 2017-03-16 09:43 UTC
Created attachment 1263609 [details]
Patch - fix _strncmp() usage

Comment 37 Ian Kent 2017-03-16 09:45 UTC
Created attachment 1263610 [details]
Patch - add function conf_amd_get_map_name()

Changed function name from conf_get_map_name() to conf_amd_get_map_name().

Comment 38 Ian Kent 2017-03-16 09:49 UTC
Created attachment 1263611 [details]
Patch - add function conf_amd_get_map_options()

Oops, actually the function name change was in this patch.
conf_get_map_options() -> conf_amd_get_map_options()

Comment 39 Ian Kent 2017-03-16 09:53 UTC
Created attachment 1263612 [details]
Patch - handle map_option cache for top level mounts (updated)

And this patch changed to use the conf_amd_get_get_map_options().

Comment 40 Ian Kent 2017-03-16 09:56 UTC
Created attachment 1263614 [details]
Patch - fix bogus check in expire_cleanup()

Dependency patch.

Comment 41 Ian Kent 2017-03-16 09:57 UTC
Created attachment 1263615 [details]
Patch - delay submount exit for amd submounts

Comment 49 Ian Kent 2017-03-28 01:19 UTC
Created attachment 1266812 [details]
Patch - use autofs_point to store expire timeout where possibe

Almost missed this patch which was partly completed.

It is needed to properly support the "utimeout" option of amd
type "auto" submounts.

Comment 51 Ian Kent 2017-03-30 08:22 UTC
Created attachment 1267442 [details]
Patch - fix possible NULL derefernce

Covarity identified fix.

Comment 53 Ian Kent 2017-04-23 23:59 UTC
Created attachment 1273487 [details]
Patch - fix invalid reference in remount_active_mount()

Fix a mistake found in testing when getting the expire timeout at startup when re-connecting to existing mounts.

Comment 58 errata-xmlrpc 2017-08-01 12:43:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2213


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