|
|
b07c2e |
autofs-5.1.4 - make umount_ent() recognise forced umount
|
|
|
b07c2e |
|
|
|
b07c2e |
From: Ian Kent <raven@themaw.net>
|
|
|
b07c2e |
|
|
|
b07c2e |
When doing a forced shutdown umount_ent() tries a normal expire
|
|
|
b07c2e |
first resulting in a fair amount of unnecessary log noise.
|
|
|
b07c2e |
|
|
|
b07c2e |
Change umount_ent() to do a forced expire when a forced shutdown
|
|
|
b07c2e |
has been requested to avoid the log noise.
|
|
|
b07c2e |
|
|
|
b07c2e |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
b07c2e |
---
|
|
|
b07c2e |
lib/mounts.c | 16 +++++++++-------
|
|
|
b07c2e |
1 file changed, 9 insertions(+), 7 deletions(-)
|
|
|
b07c2e |
|
|
|
b07c2e |
--- autofs-5.1.4.orig/lib/mounts.c
|
|
|
b07c2e |
+++ autofs-5.1.4/lib/mounts.c
|
|
|
b07c2e |
@@ -2984,14 +2984,16 @@ int umount_ent(struct autofs_point *ap,
|
|
|
b07c2e |
{
|
|
|
b07c2e |
int rv;
|
|
|
b07c2e |
|
|
|
b07c2e |
- rv = spawn_umount(ap->logopt, path, NULL);
|
|
|
b07c2e |
- /* We are doing a forced shutcwdown down so unlink busy mounts */
|
|
|
b07c2e |
- if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
|
|
|
b07c2e |
- if (ap->state == ST_SHUTDOWN_FORCE) {
|
|
|
b07c2e |
- info(ap->logopt, "forcing umount of %s", path);
|
|
|
b07c2e |
- rv = spawn_umount(ap->logopt, "-l", path, NULL);
|
|
|
b07c2e |
- }
|
|
|
b07c2e |
+ if (ap->state != ST_SHUTDOWN_FORCE)
|
|
|
b07c2e |
+ rv = spawn_umount(ap->logopt, path, NULL);
|
|
|
b07c2e |
+ else {
|
|
|
b07c2e |
+ /* We are doing a forced shutdown so unlink busy
|
|
|
b07c2e |
+ * mounts */
|
|
|
b07c2e |
+ info(ap->logopt, "forcing umount of %s", path);
|
|
|
b07c2e |
+ rv = spawn_umount(ap->logopt, "-l", path, NULL);
|
|
|
b07c2e |
+ }
|
|
|
b07c2e |
|
|
|
b07c2e |
+ if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
|
|
|
b07c2e |
/*
|
|
|
b07c2e |
* Verify that we actually unmounted the thing. This is a
|
|
|
b07c2e |
* belt and suspenders approach to not eating user data.
|