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