autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Series for the non-expiring mounts problem
@ 2011-03-30  5:49 Ian Kent
  2011-03-30  5:49 ` [PATCH 1/2] autofs-5.0.5 - fix next task list update Ian Kent
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ian Kent @ 2011-03-30  5:49 UTC (permalink / raw)
  To: Leonardo Chiquitto; +Cc: autofs, Philip Ong Jr.

These two patches should fix the problem you reported where a USR1
signal fails to trigger an expire. They should also fix the unnecessary
map reload problem.

Please test these for me.

---

Ian Kent (2):
      autofs-5.0.5 - fix stale map read
      autofs-5.0.5 - fix next task list update


 CHANGELOG        |    2 ++
 daemon/lookup.c  |    1 +
 daemon/state.c   |    9 +++++----
 include/master.h |    1 +
 lib/master.c     |   37 +++++++++++++++++++++++++------------
 5 files changed, 34 insertions(+), 16 deletions(-)

-- 
Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] autofs-5.0.5 - fix next task list update
  2011-03-30  5:49 [PATCH 0/2] Series for the non-expiring mounts problem Ian Kent
@ 2011-03-30  5:49 ` Ian Kent
  2011-03-30  5:49 ` [PATCH 2/2] autofs-5.0.5 - fix stale map read Ian Kent
  2011-03-30 16:13 ` [PATCH 0/2] Series for the non-expiring mounts problem Leonardo Chiquitto
  2 siblings, 0 replies; 5+ messages in thread
From: Ian Kent @ 2011-03-30  5:49 UTC (permalink / raw)
  To: Leonardo Chiquitto; +Cc: autofs, Philip Ong Jr.

When the state queue task manager transfered an automount point pending
task to its task queue for execution the state queue as mistakenly being
seen as empty when the completing task was the only task in the state
queue.
---

 CHANGELOG      |    1 +
 daemon/state.c |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 347d7d7..a9687b7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -62,6 +62,7 @@
 - fix mountd vers retry.
 - fix expire race.
 - replace GPLv3 code.
+- fix next task list update.
 
 03/09/2009 autofs-5.0.5
 -----------------------
diff --git a/daemon/state.c b/daemon/state.c
index 38617c3..85587bd 100644
--- a/daemon/state.c
+++ b/daemon/state.c
@@ -1150,11 +1150,13 @@ remove:
 				next = list_entry((&task->pending)->next,
 							struct state_queue, pending);
 
-				list_del_init(&next->pending);
-				list_add_tail(&next->list, p);
-
 				list_del(&task->list);
 				free(task);
+
+				list_del_init(&next->pending);
+				list_add_tail(&next->list, head);
+				if (p == head)
+					p = head->next;
 			}
 
 			if (list_empty(head))

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] autofs-5.0.5 - fix stale map read
  2011-03-30  5:49 [PATCH 0/2] Series for the non-expiring mounts problem Ian Kent
  2011-03-30  5:49 ` [PATCH 1/2] autofs-5.0.5 - fix next task list update Ian Kent
@ 2011-03-30  5:49 ` Ian Kent
  2011-03-30 16:13 ` [PATCH 0/2] Series for the non-expiring mounts problem Leonardo Chiquitto
  2 siblings, 0 replies; 5+ messages in thread
From: Ian Kent @ 2011-03-30  5:49 UTC (permalink / raw)
  To: Leonardo Chiquitto; +Cc: autofs, Philip Ong Jr.

A previous patch to fix direct maps not updating on re-read has
a side effect of causing maps to always be re-read on lookup.
This is because, following the application of the previous patch,
the map stale status is no longer being updated on a successful
map read.
---

 CHANGELOG        |    1 +
 daemon/lookup.c  |    1 +
 daemon/state.c   |    1 -
 include/master.h |    1 +
 lib/master.c     |   37 +++++++++++++++++++++++++------------
 5 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index a9687b7..fcf9145 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -63,6 +63,7 @@
 - fix expire race.
 - replace GPLv3 code.
 - fix next task list update.
+- fix stale map read.
 
 03/09/2009 autofs-5.0.5
 -----------------------
diff --git a/daemon/lookup.c b/daemon/lookup.c
index 36e60c9..0f7051b 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -1139,6 +1139,7 @@ int lookup_prune_cache(struct autofs_point *ap, time_t age)
 		cache_readlock(map->mc);
 		lookup_prune_one_cache(ap, map->mc, age);
 		pthread_cleanup_pop(1);
+		clear_stale_instances(map);
 		map->stale = 0;
 		map = map->next;
 	}
diff --git a/daemon/state.c b/daemon/state.c
index 85587bd..3645440 100644
--- a/daemon/state.c
+++ b/daemon/state.c
@@ -501,7 +501,6 @@ static void *do_readmap(void *arg)
 		pthread_cleanup_pop(1);
 		pthread_cleanup_pop(1);
 		pthread_cleanup_pop(1);
-		lookup_prune_cache(ap, now);
 	}
 
 	pthread_cleanup_pop(1);
diff --git a/include/master.h b/include/master.h
index bef59d3..1c1a7d5 100644
--- a/include/master.h
+++ b/include/master.h
@@ -89,6 +89,7 @@ struct map_source *
 master_find_source_instance(struct map_source *, const char *, const char *, int, const char **);
 struct map_source *
 master_add_source_instance(struct map_source *, const char *, const char *, time_t, int, const char **);
+void clear_stale_instances(struct map_source *);
 void send_map_update_request(struct autofs_point *);
 void master_source_writelock(struct master_mapent *);
 void master_source_readlock(struct master_mapent *);
diff --git a/lib/master.c b/lib/master.c
index 95bd3fb..4b48883 100644
--- a/lib/master.c
+++ b/lib/master.c
@@ -465,7 +465,26 @@ master_add_source_instance(struct map_source *source, const char *type, const ch
 	return new;
 }
 
-static void check_stale_instances(struct map_source *source)
+static int check_stale_instances(struct map_source *source)
+{
+	struct map_source *map;
+
+	if (!source)
+		return 0;
+
+	map = source->instance;
+	while (map) {
+		if (map->stale)
+			return 1;
+		if (check_stale_instances(map))
+			return 1;
+		map = map->next;
+	}
+
+	return 0;
+}
+
+void clear_stale_instances(struct map_source *source)
 {
 	struct map_source *map;
 
@@ -474,11 +493,9 @@ static void check_stale_instances(struct map_source *source)
 
 	map = source->instance;
 	while (map) {
-		if (map->stale) {
-			source->stale = 1;
-			break;
-		}
-		check_stale_instances(map->instance);
+		clear_stale_instances(map);
+		if (map->stale)
+			map->stale = 0;
 		map = map->next;
 	}
 
@@ -496,12 +513,8 @@ void send_map_update_request(struct autofs_point *ap)
 
 	map = ap->entry->maps;
 	while (map) {
-		check_stale_instances(map);
-		map = map->next;
-	}
-
-	map = ap->entry->maps;
-	while (map) {
+		if (check_stale_instances(map))
+			map->stale = 1;
 		if (map->stale) {
 			need_update = 1;
 			break;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Series for the non-expiring mounts problem
  2011-03-30  5:49 [PATCH 0/2] Series for the non-expiring mounts problem Ian Kent
  2011-03-30  5:49 ` [PATCH 1/2] autofs-5.0.5 - fix next task list update Ian Kent
  2011-03-30  5:49 ` [PATCH 2/2] autofs-5.0.5 - fix stale map read Ian Kent
@ 2011-03-30 16:13 ` Leonardo Chiquitto
  2011-04-29  2:52   ` Philip Ong Jr.
  2 siblings, 1 reply; 5+ messages in thread
From: Leonardo Chiquitto @ 2011-03-30 16:13 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs, Philip Ong Jr.

On Wed, Mar 30, 2011 at 2:49 AM, Ian Kent <raven@themaw.net> wrote:
> These two patches should fix the problem you reported where a USR1
> signal fails to trigger an expire. They should also fix the unnecessary
> map reload problem.
>
> Please test these for me.

Ian, thanks for the patches. I just tested them here and confirm that the
problem is resolved. I tested direct and indirect mounts letting them expire
after the default timeout and forcing the expiration with SIGUSR1.

I also confirmed that the "unmountable directories" problem reported in
http://linux.kernel.org/pipermail/autofs/2011-March/006509.html is fixed
as well (the patch I suggested back then is *not* needed).

Thanks,
Leonardo

> ---
>
> Ian Kent (2):
>      autofs-5.0.5 - fix stale map read
>      autofs-5.0.5 - fix next task list update
>
>
>  CHANGELOG        |    2 ++
>  daemon/lookup.c  |    1 +
>  daemon/state.c   |    9 +++++----
>  include/master.h |    1 +
>  lib/master.c     |   37 +++++++++++++++++++++++++------------
>  5 files changed, 34 insertions(+), 16 deletions(-)
>
> --
> Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Series for the non-expiring mounts problem
  2011-03-30 16:13 ` [PATCH 0/2] Series for the non-expiring mounts problem Leonardo Chiquitto
@ 2011-04-29  2:52   ` Philip Ong Jr.
  0 siblings, 0 replies; 5+ messages in thread
From: Philip Ong Jr. @ 2011-04-29  2:52 UTC (permalink / raw)
  To: Leonardo Chiquitto; +Cc: autofs, Ian Kent

Have the patches been released yet?

On 3/30/2011 9:13 AM, Leonardo Chiquitto wrote:
> On Wed, Mar 30, 2011 at 2:49 AM, Ian Kent<raven@themaw.net>  wrote:
>> These two patches should fix the problem you reported where a USR1
>> signal fails to trigger an expire. They should also fix the unnecessary
>> map reload problem.
>>
>> Please test these for me.
> Ian, thanks for the patches. I just tested them here and confirm that the
> problem is resolved. I tested direct and indirect mounts letting them expire
> after the default timeout and forcing the expiration with SIGUSR1.
>
> I also confirmed that the "unmountable directories" problem reported in
> http://linux.kernel.org/pipermail/autofs/2011-March/006509.html is fixed
> as well (the patch I suggested back then is *not* needed).
>
> Thanks,
> Leonardo
>
>> ---
>>
>> Ian Kent (2):
>>       autofs-5.0.5 - fix stale map read
>>       autofs-5.0.5 - fix next task list update
>>
>>
>>   CHANGELOG        |    2 ++
>>   daemon/lookup.c  |    1 +
>>   daemon/state.c   |    9 +++++----
>>   include/master.h |    1 +
>>   lib/master.c     |   37 +++++++++++++++++++++++++------------
>>   5 files changed, 34 insertions(+), 16 deletions(-)
>>
>> --
>> Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-29  2:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30  5:49 [PATCH 0/2] Series for the non-expiring mounts problem Ian Kent
2011-03-30  5:49 ` [PATCH 1/2] autofs-5.0.5 - fix next task list update Ian Kent
2011-03-30  5:49 ` [PATCH 2/2] autofs-5.0.5 - fix stale map read Ian Kent
2011-03-30 16:13 ` [PATCH 0/2] Series for the non-expiring mounts problem Leonardo Chiquitto
2011-04-29  2:52   ` Philip Ong Jr.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).