diff --git a/autofs-5.1.7-fix-nonstrict-offset-mount-fail-handling.patch b/autofs-5.1.7-fix-nonstrict-offset-mount-fail-handling.patch new file mode 100644 index 0000000..184afdf --- /dev/null +++ b/autofs-5.1.7-fix-nonstrict-offset-mount-fail-handling.patch @@ -0,0 +1,54 @@ +autofs-5.1.7 - fix nonstrict offset mount fail handling + +From: Ian Kent + +If a triggered offset mount fails automount is not handling nonstrict +mount failure correctly. + +The nonstrict mount failure handling needs to convert an offset mount +failure to a success if the offset subtree below the failed mount is not +empty otherwise it must return the failure. The previous implementation +used -1 to indicate the subtree was empty and that was used to detect +when the mount should fail instead of converting the fail to a success. + +Make the new implementation do the same. + +Signed-off-by: Ian Kent +--- + CHANGELOG | 1 + + lib/mounts.c | 2 +- + modules/parse_sun.c | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + +--- autofs-5.1.7.orig/CHANGELOG ++++ autofs-5.1.7/CHANGELOG +@@ -76,6 +76,7 @@ + - fix direct mount deadlock. + - fix lookup_prune_one_cache() refactoring change. + - add missing description of null map option. ++- fix nonstrict offset mount fail handling. + + 25/01/2021 autofs-5.1.7 + - make bind mounts propagation slave by default. +--- autofs-5.1.7.orig/lib/mounts.c ++++ autofs-5.1.7/lib/mounts.c +@@ -1616,7 +1616,7 @@ static int tree_mapent_traverse_subtree( + { + struct traverse_subtree_context *ctxt = ptr; + struct mapent *oe = MAPENT(n); +- int ret = 1; ++ int ret = -1; + + if (n->left) { + ret = tree_mapent_traverse_subtree(n->left, work, ctxt); +--- autofs-5.1.7.orig/modules/parse_sun.c ++++ autofs-5.1.7/modules/parse_sun.c +@@ -1181,7 +1181,7 @@ static int mount_subtree(struct autofs_p + * offsets to be mounted. + */ + rv = sun_mount(ap, name, name, namelen, loc, loclen, options, ctxt); +- if (rv == 0) { ++ if (rv <= 0) { + ret = tree_mapent_mount_offsets(me, 1); + if (!ret) { + tree_mapent_cleanup_offsets(me); diff --git a/autofs.spec b/autofs.spec index 65a2b0a..07fde16 100644 --- a/autofs.spec +++ b/autofs.spec @@ -12,7 +12,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.1.7 -Release: 16%{?dist} +Release: 17%{?dist} Epoch: 1 License: GPLv2+ Source: https://www.kernel.org/pub/linux/daemons/autofs/v5/autofs-%{version}-2.tar.gz @@ -97,6 +97,7 @@ Patch74: autofs-5.1.7-fix-hosts-map-offset-order.patch Patch75: autofs-5.1.7-fix-direct-mount-deadlock.patch Patch76: autofs-5.1.7-fix-lookup_prune_one_cache-refactoring-change.patch Patch77: autofs-5.1.7-add-missing-description-of-null-map-option.patch +Patch78: autofs-5.1.7-fix-nonstrict-offset-mount-fail-handling.patch %if %{with_systemd} BuildRequires: systemd-units @@ -240,6 +241,7 @@ echo %{version}-%{release} > .version %patch75 -p1 %patch76 -p1 %patch77 -p1 +%patch78 -p1 %build LDFLAGS=-Wl,-z,now @@ -348,6 +350,11 @@ fi %dir /etc/auto.master.d %changelog +* Tue Jun 22 2021 Ian Kent - 1:5.1.7-17 +- bz1973892 - /net mount being not cleanly mounted and unmounted + - correct patch, fix nonstrict offset mount fail handling. +- Related: rhbz#1973892 + * Mon Jun 14 2021 Ian Kent - 1:5.1.7-16 - bz1965870 - autofs: regression in offset ordering - fix offset entries order.