Ian Kent cc58c1
autofs-5.0.6 - report map not read when debug logging
Ian Kent cc58c1
Ian Kent cc58c1
From: Ian Kent <ikent@redhat.com>
Ian Kent cc58c1
Ian Kent cc58c1
When a map read is called automount will report that is is reading the
Ian Kent cc58c1
map when debug logging is set. If a map read is not actually needed the
Ian Kent cc58c1
lookup module read map function should also report that it didn't need
Ian Kent cc58c1
to read the map.
Ian Kent cc58c1
---
Ian Kent cc58c1
Ian Kent cc58c1
 CHANGELOG                |    1 +
Ian Kent cc58c1
 modules/lookup_hosts.c   |    4 +++-
Ian Kent cc58c1
 modules/lookup_ldap.c    |    4 +++-
Ian Kent cc58c1
 modules/lookup_nisplus.c |    4 +++-
Ian Kent cc58c1
 modules/lookup_sss.c     |    4 +++-
Ian Kent cc58c1
 modules/lookup_yp.c      |    4 +++-
Ian Kent cc58c1
 6 files changed, 16 insertions(+), 5 deletions(-)
Ian Kent cc58c1
Ian Kent cc58c1
Ian Kent cc58c1
--- autofs-5.0.6.orig/CHANGELOG
Ian Kent cc58c1
+++ autofs-5.0.6/CHANGELOG
Ian Kent cc58c1
@@ -42,6 +42,7 @@
Ian Kent cc58c1
 - fix configure string length tests for sss library.
Ian Kent cc58c1
 - fix initialization in rpc create_client().
Ian Kent cc58c1
 - fix libtirpc name clash.
Ian Kent cc58c1
+- report map not read when debug logging.
Ian Kent cc58c1
 
Ian Kent cc58c1
 28/06/2011 autofs-5.0.6
Ian Kent cc58c1
 -----------------------
Ian Kent cc58c1
--- autofs-5.0.6.orig/modules/lookup_hosts.c
Ian Kent cc58c1
+++ autofs-5.0.6/modules/lookup_hosts.c
Ian Kent cc58c1
@@ -94,8 +94,10 @@ int lookup_read_map(struct autofs_point
Ian Kent cc58c1
 	 * reading the map. We always need to read the whole map for
Ian Kent cc58c1
 	 * direct mounts in order to mount the triggers.
Ian Kent cc58c1
 	 */
Ian Kent cc58c1
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
Ian Kent cc58c1
+	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
Ian Kent cc58c1
+		debug(ap->logopt, "map read not needed, so not done");
Ian Kent cc58c1
 		return NSS_STATUS_SUCCESS;
Ian Kent cc58c1
+	}
Ian Kent cc58c1
 
Ian Kent cc58c1
 	mc = source->mc;
Ian Kent cc58c1
 
Ian Kent cc58c1
--- autofs-5.0.6.orig/modules/lookup_ldap.c
Ian Kent cc58c1
+++ autofs-5.0.6/modules/lookup_ldap.c
Ian Kent cc58c1
@@ -2326,8 +2326,10 @@ static int read_one_map(struct autofs_po
Ian Kent cc58c1
 	 * reading the map. We always need to read the whole map for
Ian Kent cc58c1
 	 * direct mounts in order to mount the triggers.
Ian Kent cc58c1
 	 */
Ian Kent cc58c1
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
Ian Kent cc58c1
+	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
Ian Kent cc58c1
+		debug(ap->logopt, "map read not needed, so not done");
Ian Kent cc58c1
 		return NSS_STATUS_SUCCESS;
Ian Kent cc58c1
+	}
Ian Kent cc58c1
 
Ian Kent cc58c1
 	sp.ap = ap;
Ian Kent cc58c1
 	sp.age = age;
Ian Kent cc58c1
--- autofs-5.0.6.orig/modules/lookup_nisplus.c
Ian Kent cc58c1
+++ autofs-5.0.6/modules/lookup_nisplus.c
Ian Kent cc58c1
@@ -185,8 +185,10 @@ int lookup_read_map(struct autofs_point
Ian Kent cc58c1
 	 * reading the map. We always need to read the whole map for
Ian Kent cc58c1
 	 * direct mounts in order to mount the triggers.
Ian Kent cc58c1
 	 */
Ian Kent cc58c1
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
Ian Kent cc58c1
+	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
Ian Kent cc58c1
+		debug(ap->logopt, "map read not needed, so not done");
Ian Kent cc58c1
 		return NSS_STATUS_SUCCESS;
Ian Kent cc58c1
+	}
Ian Kent cc58c1
 
Ian Kent cc58c1
 	mc = source->mc;
Ian Kent cc58c1
 
Ian Kent cc58c1
--- autofs-5.0.6.orig/modules/lookup_sss.c
Ian Kent cc58c1
+++ autofs-5.0.6/modules/lookup_sss.c
Ian Kent cc58c1
@@ -275,8 +275,10 @@ int lookup_read_map(struct autofs_point
Ian Kent cc58c1
 	 * reading the map. We always need to read the whole map for
Ian Kent cc58c1
 	 * direct mounts in order to mount the triggers.
Ian Kent cc58c1
 	 */
Ian Kent cc58c1
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
Ian Kent cc58c1
+	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
Ian Kent cc58c1
+		debug(ap->logopt, "map read not needed, so not done");
Ian Kent cc58c1
 		return NSS_STATUS_SUCCESS;
Ian Kent cc58c1
+	}
Ian Kent cc58c1
 
Ian Kent cc58c1
 	if (!setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt))
Ian Kent cc58c1
 		return NSS_STATUS_UNAVAIL;
Ian Kent cc58c1
--- autofs-5.0.6.orig/modules/lookup_yp.c
Ian Kent cc58c1
+++ autofs-5.0.6/modules/lookup_yp.c
Ian Kent cc58c1
@@ -327,8 +327,10 @@ int lookup_read_map(struct autofs_point
Ian Kent cc58c1
 	 * reading the map. We always need to read the whole map for
Ian Kent cc58c1
 	 * direct mounts in order to mount the triggers.
Ian Kent cc58c1
 	 */
Ian Kent cc58c1
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
Ian Kent cc58c1
+	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
Ian Kent cc58c1
+		debug(ap->logopt, "map read not needed, so not done");
Ian Kent cc58c1
 		return NSS_STATUS_SUCCESS;
Ian Kent cc58c1
+	}
Ian Kent cc58c1
 
Ian Kent cc58c1
 	ypcb_data.ap = ap;
Ian Kent cc58c1
 	ypcb_data.source = source;