|
|
306fa1 |
autofs-5.1.3 - add function umount_amd_ext_mount()
|
|
|
306fa1 |
|
|
|
306fa1 |
From: Ian Kent <raven@themaw.net>
|
|
|
306fa1 |
|
|
|
306fa1 |
Refactor amd external umount code, move the code into its own
|
|
|
306fa1 |
function.
|
|
|
306fa1 |
|
|
|
306fa1 |
Later amd umounting of program mounts with a custom command will
|
|
|
306fa1 |
be added.
|
|
|
306fa1 |
|
|
|
306fa1 |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
306fa1 |
---
|
|
|
306fa1 |
CHANGELOG | 1 +
|
|
|
306fa1 |
daemon/automount.c | 22 ++--------------------
|
|
|
306fa1 |
include/mounts.h | 1 +
|
|
|
306fa1 |
lib/mounts.c | 17 +++++++++++++++++
|
|
|
306fa1 |
modules/parse_amd.c | 3 +--
|
|
|
306fa1 |
5 files changed, 22 insertions(+), 22 deletions(-)
|
|
|
306fa1 |
|
|
|
306fa1 |
--- autofs-5.0.7.orig/CHANGELOG
|
|
|
306fa1 |
+++ autofs-5.0.7/CHANGELOG
|
|
|
306fa1 |
@@ -278,6 +278,7 @@
|
|
|
306fa1 |
- fix expandamdent() quote handling.
|
|
|
306fa1 |
- fix possible memory leak during amd parse.
|
|
|
306fa1 |
- remove path restriction of amd external mount.
|
|
|
306fa1 |
+- add function umount_amd_ext_mount().
|
|
|
306fa1 |
|
|
|
306fa1 |
25/07/2012 autofs-5.0.7
|
|
|
306fa1 |
=======================
|
|
|
306fa1 |
--- autofs-5.0.7.orig/daemon/automount.c
|
|
|
306fa1 |
+++ autofs-5.0.7/daemon/automount.c
|
|
|
306fa1 |
@@ -614,16 +614,7 @@ static int umount_subtree_mounts(struct
|
|
|
306fa1 |
}
|
|
|
306fa1 |
list_del(&entry->entries);
|
|
|
306fa1 |
mounts_mutex_unlock(ap);
|
|
|
306fa1 |
- if (ext_mount_remove(&entry->ext_mount, entry->fs)) {
|
|
|
306fa1 |
- if (umount_ent(ap, entry->fs))
|
|
|
306fa1 |
- debug(ap->logopt,
|
|
|
306fa1 |
- "failed to umount external mount %s",
|
|
|
306fa1 |
- entry->fs);
|
|
|
306fa1 |
- else
|
|
|
306fa1 |
- debug(ap->logopt,
|
|
|
306fa1 |
- "umounted external mount %s",
|
|
|
306fa1 |
- entry->fs);
|
|
|
306fa1 |
- }
|
|
|
306fa1 |
+ umount_amd_ext_mount(ap, entry);
|
|
|
306fa1 |
free_amd_entry(entry);
|
|
|
306fa1 |
}
|
|
|
306fa1 |
done:
|
|
|
306fa1 |
@@ -670,16 +661,7 @@ int umount_multi(struct autofs_point *ap
|
|
|
306fa1 |
}
|
|
|
306fa1 |
list_del(&entry->entries);
|
|
|
306fa1 |
mounts_mutex_unlock(ap);
|
|
|
306fa1 |
- if (ext_mount_remove(&entry->ext_mount, entry->fs)) {
|
|
|
306fa1 |
- if (umount_ent(ap, entry->fs))
|
|
|
306fa1 |
- debug(ap->logopt,
|
|
|
306fa1 |
- "failed to umount external mount %s",
|
|
|
306fa1 |
- entry->fs);
|
|
|
306fa1 |
- else
|
|
|
306fa1 |
- debug(ap->logopt,
|
|
|
306fa1 |
- "umounted external mount %s",
|
|
|
306fa1 |
- entry->fs);
|
|
|
306fa1 |
- }
|
|
|
306fa1 |
+ umount_amd_ext_mount(ap, entry);
|
|
|
306fa1 |
free_amd_entry(entry);
|
|
|
306fa1 |
return 0;
|
|
|
306fa1 |
}
|
|
|
306fa1 |
--- autofs-5.0.7.orig/include/mounts.h
|
|
|
306fa1 |
+++ autofs-5.0.7/include/mounts.h
|
|
|
306fa1 |
@@ -118,6 +118,7 @@ int try_remount(struct autofs_point *, s
|
|
|
306fa1 |
void set_indirect_mount_tree_catatonic(struct autofs_point *);
|
|
|
306fa1 |
void set_direct_mount_tree_catatonic(struct autofs_point *, struct mapent *);
|
|
|
306fa1 |
int umount_ent(struct autofs_point *, const char *);
|
|
|
306fa1 |
+int umount_amd_ext_mount(struct autofs_point *, struct amd_entry *);
|
|
|
306fa1 |
int mount_multi_triggers(struct autofs_point *, struct mapent *, const char *, unsigned int, const char *);
|
|
|
306fa1 |
int umount_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *);
|
|
|
306fa1 |
int clean_stale_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *);
|
|
|
306fa1 |
--- autofs-5.0.7.orig/lib/mounts.c
|
|
|
306fa1 |
+++ autofs-5.0.7/lib/mounts.c
|
|
|
306fa1 |
@@ -2035,6 +2035,23 @@ int umount_ent(struct autofs_point *ap,
|
|
|
306fa1 |
return rv;
|
|
|
306fa1 |
}
|
|
|
306fa1 |
|
|
|
306fa1 |
+int umount_amd_ext_mount(struct autofs_point *ap, struct amd_entry *entry)
|
|
|
306fa1 |
+{
|
|
|
306fa1 |
+ int rv = 1;
|
|
|
306fa1 |
+
|
|
|
306fa1 |
+ if (ext_mount_remove(&entry->ext_mount, entry->fs)) {
|
|
|
306fa1 |
+ rv = umount_ent(ap, entry->fs);
|
|
|
306fa1 |
+ if (rv)
|
|
|
306fa1 |
+ error(ap->logopt,
|
|
|
306fa1 |
+ "failed to umount external mount %s", entry->fs);
|
|
|
306fa1 |
+ else
|
|
|
306fa1 |
+ debug(ap->logopt,
|
|
|
306fa1 |
+ "umounted external mount %s", entry->fs);
|
|
|
306fa1 |
+ }
|
|
|
306fa1 |
+
|
|
|
306fa1 |
+ return rv;
|
|
|
306fa1 |
+}
|
|
|
306fa1 |
+
|
|
|
306fa1 |
static int do_mount_autofs_offset(struct autofs_point *ap,
|
|
|
306fa1 |
struct mapent *oe, const char *root,
|
|
|
306fa1 |
char *offset)
|
|
|
306fa1 |
--- autofs-5.0.7.orig/modules/parse_amd.c
|
|
|
306fa1 |
+++ autofs-5.0.7/modules/parse_amd.c
|
|
|
306fa1 |
@@ -982,8 +982,7 @@ symlink:
|
|
|
306fa1 |
|
|
|
306fa1 |
if (entry->sublink) {
|
|
|
306fa1 |
/* failed to complete sublink mount */
|
|
|
306fa1 |
- if (ext_mount_remove(&entry->ext_mount, entry->fs))
|
|
|
306fa1 |
- umount_ent(ap, entry->fs);
|
|
|
306fa1 |
+ umount_amd_ext_mount(ap, entry);
|
|
|
306fa1 |
}
|
|
|
306fa1 |
out:
|
|
|
306fa1 |
return ret;
|