Blob Blame History Raw
autofs-5.1.7 - simplify mount_subtree() mount check

From: Ian Kent <raven@themaw.net>

The check of the return from sun_mount() following the possible mount
of the root offset in mount_subtree() can be simpler.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG           |    1 +
 modules/parse_sun.c |   10 +---------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index b1ce7b69..f5c5641a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,7 @@
 - remove unused parameter form do_mount_autofs_offset().
 - refactor umount_multi_triggers().
 - eliminate clean_stale_multi_triggers().
+- simplify mount_subtree() mount check.
 
 25/01/2021 autofs-5.1.7
 - make bind mounts propagation slave by default.
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
index f4d5125c..1142e8a3 100644
--- a/modules/parse_sun.c
+++ b/modules/parse_sun.c
@@ -1203,15 +1203,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me,
 				free(ro_loc);
 		}
 
-		if (ro && rv == 0) {
-			ret = mount_multi_triggers(ap, me, mm_root, start, mm_base);
-			if (ret == -1) {
-				error(ap->logopt, MODPREFIX
-					 "failed to mount offset triggers");
-				cleanup_multi_triggers(ap, me, mm_root, start, mm_base);
-				return 1;
-			}
-		} else if (rv <= 0) {
+		if ((ro && rv == 0) || rv <= 0) {
 			ret = mount_multi_triggers(ap, me, mm_root, start, mm_base);
 			if (ret == -1) {
 				error(ap->logopt, MODPREFIX