Blame SOURCES/autofs-5.1.8-simplify-cache_add-a-little.patch

b07c2e
autofs-5.1.8 - simplify cache_add() a little
b07c2e
b07c2e
From: Ian Kent <raven@themaw.net>
b07c2e
b07c2e
If a map entry is being added to an existing hash chain there's an
b07c2e
unneccessarily complicted setting of ->next of the last entry.
b07c2e
b07c2e
Just initialize the map entry ->next field instead and remove the
b07c2e
confusing assignment.
b07c2e
b07c2e
Signed-off-by: Ian Kent <raven@themaw.net>
b07c2e
---
b07c2e
 CHANGELOG   |    1 +
b07c2e
 lib/cache.c |    2 +-
b07c2e
 2 files changed, 2 insertions(+), 1 deletion(-)
b07c2e
b07c2e
--- autofs-5.1.4.orig/CHANGELOG
b07c2e
+++ autofs-5.1.4/CHANGELOG
b07c2e
@@ -87,6 +87,7 @@
b07c2e
 - fix nonstrict fail handling of last offset mount.
b07c2e
 - dont fail on duplicate offset entry tree add.
b07c2e
 - fix loop under run in cache_get_offset_parent().
b07c2e
+- simplify cache_add() a little.
b07c2e
 
b07c2e
 xx/xx/2018 autofs-5.1.5
b07c2e
 - fix flag file permission.
b07c2e
--- autofs-5.1.4.orig/lib/cache.c
b07c2e
+++ autofs-5.1.4/lib/cache.c
b07c2e
@@ -564,6 +564,7 @@ int cache_add(struct mapent_cache *mc, s
b07c2e
 	me->dev = (dev_t) -1;
b07c2e
 	me->ino = (ino_t) -1;
b07c2e
 	me->flags = 0;
b07c2e
+	me->next = NULL;
b07c2e
 
b07c2e
 	/* 
b07c2e
 	 * We need to add to the end if values exist in order to
b07c2e
@@ -583,7 +584,6 @@ int cache_add(struct mapent_cache *mc, s
b07c2e
 
b07c2e
 			existing = next;
b07c2e
 		}
b07c2e
-		me->next = existing->next;
b07c2e
 		existing->next = me;
b07c2e
 	}
b07c2e
 	return CHE_OK;