From 84edb063a97980b1d985f64f24a94b0cb6c9c09c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Apr 16 2021 22:13:58 +0000 Subject: Apply patch autofs-5.1.6-move-submount-check-into-conditional_alarm_add.patch patch_name: autofs-5.1.6-move-submount-check-into-conditional_alarm_add.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 900dd21..159dd3d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -132,6 +132,7 @@ xx/xx/2018 autofs-5.1.5 - use struct mnt_list mounted list for expire. - remove unused function tree_get_mnt_list(). - only add expre alarm for active mounts. +- move submount check into conditional_alarm_add(). 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/daemon/automount.c b/daemon/automount.c index b4b3b00..49e8a8b 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -1843,8 +1843,7 @@ int handle_mounts_exit(struct autofs_point *ap) } if (ap->state != ST_SHUTDOWN) { - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); /* Return to ST_READY is done immediately */ st_add_task(ap, ST_READY); if (ap->submount) @@ -1888,8 +1887,7 @@ int handle_mounts_exit(struct autofs_point *ap) /* Failed shutdown returns to ready */ warn(ap->logopt, "can't shutdown: filesystem %s still busy", ap->path); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); /* Return to ST_READY is done immediately */ st_add_task(ap, ST_READY); if (ap->submount) diff --git a/daemon/direct.c b/daemon/direct.c index cddf559..9fe4903 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -1246,8 +1246,7 @@ static void *do_mount_direct(void *arg) mnts_set_mounted_mount(ap, mt.name); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); } else { /* TODO: get mount return status from lookup_nss_mount */ ops->send_fail(ap->logopt, diff --git a/daemon/indirect.c b/daemon/indirect.c index db45c38..65cfe4e 100644 --- a/daemon/indirect.c +++ b/daemon/indirect.c @@ -754,8 +754,7 @@ static void *do_mount_indirect(void *arg) mnts_set_mounted_mount(ap, mt.name); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); } else { /* TODO: get mount return status from lookup_nss_mount */ ops->send_fail(ap->logopt, diff --git a/daemon/state.c b/daemon/state.c index 9eb5a90..66f20fb 100644 --- a/daemon/state.c +++ b/daemon/state.c @@ -154,7 +154,7 @@ void expire_cleanup(void *arg) } else if (ap->submount > 1) ap->submount = 1; - if (ap->state == ST_EXPIRE && !ap->submount) + if (ap->state == ST_EXPIRE) conditional_alarm_add(ap, ap->exp_runfreq); /* FALLTHROUGH */ @@ -172,8 +172,7 @@ void expire_cleanup(void *arg) rv = ops->askumount(ap->logopt, ap->ioctlfd, &idle); if (!rv && !idle && !ap->shutdown) { next = ST_READY; - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); break; } @@ -186,8 +185,7 @@ void expire_cleanup(void *arg) /* Failed shutdown returns to ready */ warn(ap->logopt, "filesystem %s still busy", ap->path); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); next = ST_READY; break; #endif @@ -577,8 +575,7 @@ static unsigned int st_readmap(struct autofs_point *ap) error(ap->logopt, "failed to malloc readmap cond struct"); /* It didn't work: return to ready */ st_ready(ap); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); return 0; } @@ -604,8 +601,7 @@ static unsigned int st_readmap(struct autofs_point *ap) free(ra); /* It didn't work: return to ready */ st_ready(ap); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); return 0; } ap->readmap_thread = thid; @@ -640,8 +636,7 @@ static unsigned int st_prepare_shutdown(struct autofs_point *ap) case EXP_ERROR: case EXP_PARTIAL: /* It didn't work: return to ready */ - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); st_ready(ap); return 0; @@ -666,8 +661,7 @@ static unsigned int st_force_shutdown(struct autofs_point *ap) case EXP_ERROR: case EXP_PARTIAL: /* It didn't work: return to ready */ - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); st_ready(ap); return 0; @@ -699,8 +693,7 @@ static unsigned int st_prune(struct autofs_point *ap) switch (expire_proc(ap, AUTOFS_EXP_IMMEDIATE)) { case EXP_ERROR: case EXP_PARTIAL: - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); st_ready(ap); return 0; @@ -720,8 +713,7 @@ static unsigned int st_expire(struct autofs_point *ap) switch (expire_proc(ap, AUTOFS_EXP_NORMAL)) { case EXP_ERROR: case EXP_PARTIAL: - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); st_ready(ap); return 0; diff --git a/lib/alarm.c b/lib/alarm.c index 6ab4a49..f27e13c 100755 --- a/lib/alarm.c +++ b/lib/alarm.c @@ -187,6 +187,8 @@ int conditional_alarm_add(struct autofs_point *ap, time_t seconds) { int status; + if (ap->submount) + return 1; if (!mnts_has_mounted_mounts(ap)) return 1; diff --git a/lib/mounts.c b/lib/mounts.c index ff6df5c..6c7a8e8 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -1921,8 +1921,7 @@ static int do_remount_direct(struct autofs_point *ap, info(ap->logopt, "re-connected to %s", path); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); } else { status = REMOUNT_FAIL; info(ap->logopt, "failed to re-connect %s", path); @@ -1997,8 +1996,7 @@ static int do_remount_indirect(struct autofs_point *ap, const unsigned int type, info(ap->logopt, "re-connected to %s", buf); - if (!ap->submount) - conditional_alarm_add(ap, ap->exp_runfreq); + conditional_alarm_add(ap, ap->exp_runfreq); } else { status = REMOUNT_FAIL; info(ap->logopt, "failed to re-connect %s", buf);