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