summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch')
-rw-r--r--meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch
new file mode 100644
index 0000000000..610afaaa7a
--- /dev/null
+++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch
@@ -0,0 +1,81 @@
1autofs-5.0.7 - fix null map entry order handling
2
3From: Ian Kent <ikent@redhat.com>
4
5If a null map entry appears after a corresponding indirect map entry
6autofs doesn't handle it properly.
7
8Since it appears after the map entry it should'nt affect it but autofs
9doesn't account for this case and assumes the map entry is already
10mounted and tries to shut it down causing attempted access to facilities
11that don't exist.
12---
13
14 CHANGELOG | 1 +
15 lib/master.c | 32 +++++++++++++++++++++++++++++---
16 2 files changed, 30 insertions(+), 3 deletions(-)
17
18
19diff --git a/CHANGELOG b/CHANGELOG
20index 7b8d185..79cf673 100644
21--- a/CHANGELOG
22+++ b/CHANGELOG
23@@ -7,6 +7,7 @@
24 - fix typo in automount(8).
25 - dont wait forever to restart.
26 - add timeout option description to man page.
27+- fix null map entry order handling.
28
29 25/07/2012 autofs-5.0.7
30 =======================
31diff --git a/lib/master.c b/lib/master.c
32index 904b13d..a0e62f2 100644
33--- a/lib/master.c
34+++ b/lib/master.c
35@@ -1179,9 +1179,35 @@ int master_mount_mounts(struct master *master, time_t age, int readall)
36
37 cache_readlock(nc);
38 ne = cache_lookup_distinct(nc, this->path);
39- if (ne && this->age > ne->age) {
40+ /*
41+ * If this path matched a nulled entry the master map entry
42+ * must be an indirect mount so the master map entry line
43+ * number may be obtained from this->maps.
44+ */
45+ if (ne) {
46+ int lineno = ne->age;
47 cache_unlock(nc);
48- st_add_task(ap, ST_SHUTDOWN_PENDING);
49+
50+ /* null entry appears after map entry */
51+ if (this->maps->master_line < lineno) {
52+ warn(ap->logopt,
53+ "ignoring null entry that appears after "
54+ "existing entry for %s", this->path);
55+ goto cont;
56+ }
57+ if (ap->state != ST_INIT) {
58+ st_add_task(ap, ST_SHUTDOWN_PENDING);
59+ continue;
60+ }
61+ /*
62+ * The map entry hasn't been started yet and we've
63+ * seen a preceeding null map entry for it so just
64+ * delete it from the master map entry list so it
65+ * doesn't get in the road.
66+ */
67+ list_del_init(&this->list);
68+ master_free_mapent_sources(ap->entry, 1);
69+ master_free_mapent(ap->entry);
70 continue;
71 }
72 nested = cache_partial_match(nc, this->path);
73@@ -1194,7 +1220,7 @@ int master_mount_mounts(struct master *master, time_t age, int readall)
74 cache_delete(nc, nested->key);
75 }
76 cache_unlock(nc);
77-
78+cont:
79 st_mutex_lock();
80
81 state_pipe = this->ap->state_pipe[1];