|
|
8fa62f |
autofs-5.1.5 - always use PROC_MOUNTS to make mount lists
|
|
|
8fa62f |
|
|
|
8fa62f |
From: Ian Kent <raven@themaw.net>
|
|
|
8fa62f |
|
|
|
8fa62f |
If it's necessary to read a mount table then always use the proc file
|
|
|
8fa62f |
system mount table.
|
|
|
8fa62f |
|
|
|
8fa62f |
This could be very inefficient for cases where the mtab (_PATH_MOUNTED)
|
|
|
8fa62f |
is specified but the mtab has been a symlink to the proc mount tables
|
|
|
8fa62f |
for quite a while now so it doesn't make any difference always using
|
|
|
8fa62f |
the proc tables.
|
|
|
8fa62f |
|
|
|
8fa62f |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
8fa62f |
---
|
|
|
8fa62f |
CHANGELOG | 1 +
|
|
|
8fa62f |
daemon/automount.c | 6 +++---
|
|
|
8fa62f |
daemon/direct.c | 14 +++++++-------
|
|
|
8fa62f |
daemon/indirect.c | 8 ++++----
|
|
|
8fa62f |
daemon/lookup.c | 4 ++--
|
|
|
8fa62f |
daemon/spawn.c | 2 +-
|
|
|
8fa62f |
daemon/state.c | 2 +-
|
|
|
8fa62f |
include/mounts.h | 6 +++---
|
|
|
8fa62f |
lib/mounts.c | 40 ++++++++++++++++++++--------------------
|
|
|
8fa62f |
modules/parse_amd.c | 4 ++--
|
|
|
8fa62f |
10 files changed, 44 insertions(+), 43 deletions(-)
|
|
|
8fa62f |
|
|
|
8fa62f |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
8fa62f |
+++ autofs-5.1.4/CHANGELOG
|
|
|
8fa62f |
@@ -65,6 +65,7 @@ xx/xx/2018 autofs-5.1.5
|
|
|
8fa62f |
- add config option for "ignore" mount option
|
|
|
8fa62f |
- use bit flags for autofs mount types in mnt_list.
|
|
|
8fa62f |
- use mp instead of path in mnt_list entries.
|
|
|
8fa62f |
+- always use PROC_MOUNTS to make mount lists.
|
|
|
8fa62f |
|
|
|
8fa62f |
19/12/2017 autofs-5.1.4
|
|
|
8fa62f |
- fix spec file url.
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/automount.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/automount.c
|
|
|
8fa62f |
@@ -333,7 +333,7 @@ static int walk_tree(const char *base, i
|
|
|
8fa62f |
struct stat st, *pst = &st;
|
|
|
8fa62f |
int ret;
|
|
|
8fa62f |
|
|
|
8fa62f |
- if (!is_mounted(_PATH_MOUNTED, base, MNTS_REAL))
|
|
|
8fa62f |
+ if (!is_mounted(base, MNTS_REAL))
|
|
|
8fa62f |
ret = lstat(base, pst);
|
|
|
8fa62f |
else {
|
|
|
8fa62f |
pst = NULL;
|
|
|
8fa62f |
@@ -593,11 +593,11 @@ static int umount_subtree_mounts(struct
|
|
|
8fa62f |
* If this is the root of a multi-mount we've had to umount
|
|
|
8fa62f |
* it already to ensure it's ok to remove any offset triggers.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
- if (!is_mm_root && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (!is_mm_root && is_mounted(path, MNTS_REAL)) {
|
|
|
8fa62f |
struct amd_entry *entry;
|
|
|
8fa62f |
debug(ap->logopt, "unmounting dir = %s", path);
|
|
|
8fa62f |
if (umount_ent(ap, path) &&
|
|
|
8fa62f |
- is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(path, MNTS_REAL)) {
|
|
|
8fa62f |
warn(ap->logopt, "could not umount dir %s", path);
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
goto done;
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/direct.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/direct.c
|
|
|
8fa62f |
@@ -207,7 +207,7 @@ int umount_autofs_direct(struct autofs_p
|
|
|
8fa62f |
struct mnt_list *mnts;
|
|
|
8fa62f |
struct mapent *me, *ne;
|
|
|
8fa62f |
|
|
|
8fa62f |
- mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/");
|
|
|
8fa62f |
+ mnts = tree_make_mnt_tree("/");
|
|
|
8fa62f |
pthread_cleanup_push(mnts_cleanup, mnts);
|
|
|
8fa62f |
nc = ap->entry->master->nc;
|
|
|
8fa62f |
cache_readlock(nc);
|
|
|
8fa62f |
@@ -515,7 +515,7 @@ int mount_autofs_direct(struct autofs_po
|
|
|
8fa62f |
return -1;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
- mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/");
|
|
|
8fa62f |
+ mnts = tree_make_mnt_tree("/");
|
|
|
8fa62f |
pthread_cleanup_push(mnts_cleanup, mnts);
|
|
|
8fa62f |
pthread_cleanup_push(master_source_lock_cleanup, ap->entry);
|
|
|
8fa62f |
master_source_readlock(ap->entry);
|
|
|
8fa62f |
@@ -583,7 +583,7 @@ int umount_autofs_offset(struct autofs_p
|
|
|
8fa62f |
int opened = 0;
|
|
|
8fa62f |
|
|
|
8fa62f |
if (me->ioctlfd != -1) {
|
|
|
8fa62f |
- if (is_mounted(_PATH_MOUNTED, me->key, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (is_mounted(me->key, MNTS_REAL)) {
|
|
|
8fa62f |
error(ap->logopt,
|
|
|
8fa62f |
"attempt to umount busy offset %s", me->key);
|
|
|
8fa62f |
return 1;
|
|
|
8fa62f |
@@ -591,7 +591,7 @@ int umount_autofs_offset(struct autofs_p
|
|
|
8fa62f |
ioctlfd = me->ioctlfd;
|
|
|
8fa62f |
} else {
|
|
|
8fa62f |
/* offset isn't mounted, return success and try to recover */
|
|
|
8fa62f |
- if (!is_mounted(_PROC_MOUNTS, me->key, MNTS_AUTOFS)) {
|
|
|
8fa62f |
+ if (!is_mounted(me->key, MNTS_AUTOFS)) {
|
|
|
8fa62f |
debug(ap->logopt,
|
|
|
8fa62f |
"offset %s not mounted",
|
|
|
8fa62f |
me->key);
|
|
|
8fa62f |
@@ -707,7 +707,7 @@ int mount_autofs_offset(struct autofs_po
|
|
|
8fa62f |
if (!(ret == -1 && errno == ENOENT))
|
|
|
8fa62f |
return MOUNT_OFFSET_FAIL;
|
|
|
8fa62f |
} else {
|
|
|
8fa62f |
- if (is_mounted(_PROC_MOUNTS, me->key, MNTS_AUTOFS)) {
|
|
|
8fa62f |
+ if (is_mounted(me->key, MNTS_AUTOFS)) {
|
|
|
8fa62f |
if (ap->state != ST_READMAP)
|
|
|
8fa62f |
warn(ap->logopt,
|
|
|
8fa62f |
"trigger %s already mounted", me->key);
|
|
|
8fa62f |
@@ -781,7 +781,7 @@ int mount_autofs_offset(struct autofs_po
|
|
|
8fa62f |
* the kernel NFS client.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
if (me->multi != me &&
|
|
|
8fa62f |
- is_mounted(_PROC_MOUNTS, mountpoint, MNTS_REAL))
|
|
|
8fa62f |
+ is_mounted(mountpoint, MNTS_REAL))
|
|
|
8fa62f |
return MOUNT_OFFSET_IGNORE;
|
|
|
8fa62f |
|
|
|
8fa62f |
/*
|
|
|
8fa62f |
@@ -901,7 +901,7 @@ void *expire_proc_direct(void *arg)
|
|
|
8fa62f |
|
|
|
8fa62f |
left = 0;
|
|
|
8fa62f |
|
|
|
8fa62f |
- mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/");
|
|
|
8fa62f |
+ mnts = tree_make_mnt_tree("/");
|
|
|
8fa62f |
pthread_cleanup_push(mnts_cleanup, mnts);
|
|
|
8fa62f |
|
|
|
8fa62f |
/* Get a list of mounts select real ones and expire them if possible */
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/indirect.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/indirect.c
|
|
|
8fa62f |
@@ -104,7 +104,7 @@ static int do_mount_autofs_indirect(stru
|
|
|
8fa62f |
if (ret == 0)
|
|
|
8fa62f |
return -1;
|
|
|
8fa62f |
} else {
|
|
|
8fa62f |
- mnts = get_mnt_list(_PROC_MOUNTS, ap->path, 1);
|
|
|
8fa62f |
+ mnts = get_mnt_list(ap->path, 1);
|
|
|
8fa62f |
if (mnts) {
|
|
|
8fa62f |
ret = unlink_mount_tree(ap, mnts);
|
|
|
8fa62f |
free_mnt_list(mnts);
|
|
|
8fa62f |
@@ -433,7 +433,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
left = 0;
|
|
|
8fa62f |
|
|
|
8fa62f |
/* Get a list of real mounts and expire them if possible */
|
|
|
8fa62f |
- mnts = get_mnt_list(_PROC_MOUNTS, ap->path, 0);
|
|
|
8fa62f |
+ mnts = get_mnt_list(ap->path, 0);
|
|
|
8fa62f |
pthread_cleanup_push(mnts_cleanup, mnts);
|
|
|
8fa62f |
for (next = mnts; next; next = next->next) {
|
|
|
8fa62f |
char *ind_key;
|
|
|
8fa62f |
@@ -454,7 +454,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
struct stat st;
|
|
|
8fa62f |
|
|
|
8fa62f |
/* It's got a mount, deal with in the outer loop */
|
|
|
8fa62f |
- if (is_mounted(_PATH_MOUNTED, next->mp, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (is_mounted(next->mp, MNTS_REAL)) {
|
|
|
8fa62f |
pthread_setcancelstate(cur_state, NULL);
|
|
|
8fa62f |
continue;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
@@ -563,7 +563,7 @@ void *expire_proc_indirect(void *arg)
|
|
|
8fa62f |
pthread_cleanup_pop(1);
|
|
|
8fa62f |
|
|
|
8fa62f |
count = offsets = submnts = 0;
|
|
|
8fa62f |
- mnts = get_mnt_list(_PROC_MOUNTS, ap->path, 0);
|
|
|
8fa62f |
+ mnts = get_mnt_list(ap->path, 0);
|
|
|
8fa62f |
pthread_cleanup_push(mnts_cleanup, mnts);
|
|
|
8fa62f |
/* Are there any real mounts left */
|
|
|
8fa62f |
for (next = mnts; next; next = next->next) {
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/lookup.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/lookup.c
|
|
|
8fa62f |
@@ -1425,7 +1425,7 @@ void lookup_prune_one_cache(struct autof
|
|
|
8fa62f |
valid = NULL;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
if (!valid &&
|
|
|
8fa62f |
- is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(path, MNTS_REAL)) {
|
|
|
8fa62f |
debug(ap->logopt, "prune posponed, %s mounted", path);
|
|
|
8fa62f |
free(key);
|
|
|
8fa62f |
free(path);
|
|
|
8fa62f |
@@ -1448,7 +1448,7 @@ void lookup_prune_one_cache(struct autof
|
|
|
8fa62f |
|
|
|
8fa62f |
if (valid)
|
|
|
8fa62f |
cache_delete(mc, key);
|
|
|
8fa62f |
- else if (!is_mounted(_PROC_MOUNTS, path, MNTS_AUTOFS)) {
|
|
|
8fa62f |
+ else if (!is_mounted(path, MNTS_AUTOFS)) {
|
|
|
8fa62f |
dev_t devid = ap->dev;
|
|
|
8fa62f |
status = CHE_FAIL;
|
|
|
8fa62f |
if (ap->type == LKP_DIRECT)
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/spawn.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/spawn.c
|
|
|
8fa62f |
@@ -427,7 +427,7 @@ static int do_spawn(unsigned logopt, uns
|
|
|
8fa62f |
if (!is_bind)
|
|
|
8fa62f |
goto done;
|
|
|
8fa62f |
|
|
|
8fa62f |
- if (is_mounted(_PROC_MOUNTS, argv[loc], MNTS_AUTOFS)) {
|
|
|
8fa62f |
+ if (is_mounted(argv[loc], MNTS_AUTOFS)) {
|
|
|
8fa62f |
fprintf(stderr,
|
|
|
8fa62f |
"error: can't bind to an autofs mount\n");
|
|
|
8fa62f |
close(STDOUT_FILENO);
|
|
|
8fa62f |
--- autofs-5.1.4.orig/daemon/state.c
|
|
|
8fa62f |
+++ autofs-5.1.4/daemon/state.c
|
|
|
8fa62f |
@@ -499,7 +499,7 @@ static void *do_readmap(void *arg)
|
|
|
8fa62f |
struct mapent *me;
|
|
|
8fa62f |
unsigned int append_alarm = !ap->exp_runfreq;
|
|
|
8fa62f |
|
|
|
8fa62f |
- mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/");
|
|
|
8fa62f |
+ mnts = tree_make_mnt_tree("/");
|
|
|
8fa62f |
pthread_cleanup_push(tree_mnts_cleanup, mnts);
|
|
|
8fa62f |
nc = ap->entry->master->nc;
|
|
|
8fa62f |
cache_readlock(nc);
|
|
|
8fa62f |
--- autofs-5.1.4.orig/include/mounts.h
|
|
|
8fa62f |
+++ autofs-5.1.4/include/mounts.h
|
|
|
8fa62f |
@@ -99,11 +99,11 @@ char *make_mnt_name_string(char *path);
|
|
|
8fa62f |
int ext_mount_add(struct list_head *, const char *, unsigned int);
|
|
|
8fa62f |
int ext_mount_remove(struct list_head *, const char *);
|
|
|
8fa62f |
int ext_mount_inuse(const char *);
|
|
|
8fa62f |
-struct mnt_list *get_mnt_list(const char *table, const char *path, int include);
|
|
|
8fa62f |
+struct mnt_list *get_mnt_list(const char *path, int include);
|
|
|
8fa62f |
void free_mnt_list(struct mnt_list *list);
|
|
|
8fa62f |
-int is_mounted(const char *table, const char *mp, unsigned int type);
|
|
|
8fa62f |
+int is_mounted(const char *mp, unsigned int type);
|
|
|
8fa62f |
void tree_free_mnt_tree(struct mnt_list *tree);
|
|
|
8fa62f |
-struct mnt_list *tree_make_mnt_tree(const char *table, const char *path);
|
|
|
8fa62f |
+struct mnt_list *tree_make_mnt_tree(const char *path);
|
|
|
8fa62f |
int tree_get_mnt_list(struct mnt_list *mnts, struct list_head *list, const char *path, int include);
|
|
|
8fa62f |
int tree_get_mnt_sublist(struct mnt_list *mnts, struct list_head *list, const char *path, int include);
|
|
|
8fa62f |
int tree_find_mnt_ents(struct mnt_list *mnts, struct list_head *list, const char *path);
|
|
|
8fa62f |
--- autofs-5.1.4.orig/lib/mounts.c
|
|
|
8fa62f |
+++ autofs-5.1.4/lib/mounts.c
|
|
|
8fa62f |
@@ -789,7 +789,7 @@ done:
|
|
|
8fa62f |
/*
|
|
|
8fa62f |
* Get list of mounts under path in longest->shortest order
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
-struct mnt_list *get_mnt_list(const char *table, const char *path, int include)
|
|
|
8fa62f |
+struct mnt_list *get_mnt_list(const char *path, int include)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
FILE *tab;
|
|
|
8fa62f |
size_t pathlen = strlen(path);
|
|
|
8fa62f |
@@ -803,7 +803,7 @@ struct mnt_list *get_mnt_list(const char
|
|
|
8fa62f |
if (!path || !pathlen || pathlen > PATH_MAX)
|
|
|
8fa62f |
return NULL;
|
|
|
8fa62f |
|
|
|
8fa62f |
- tab = open_setmntent_r(table);
|
|
|
8fa62f |
+ tab = open_setmntent_r(_PROC_MOUNTS);
|
|
|
8fa62f |
if (!tab) {
|
|
|
8fa62f |
char *estr = strerror_r(errno, buf, PATH_MAX - 1);
|
|
|
8fa62f |
logerr("setmntent: %s", estr);
|
|
|
8fa62f |
@@ -892,7 +892,7 @@ void free_mnt_list(struct mnt_list *list
|
|
|
8fa62f |
}
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
-static int table_is_mounted(const char *table, const char *mp, unsigned int type)
|
|
|
8fa62f |
+static int table_is_mounted(const char *mp, unsigned int type)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
struct mntent *mnt;
|
|
|
8fa62f |
struct mntent mnt_wrk;
|
|
|
8fa62f |
@@ -904,7 +904,7 @@ static int table_is_mounted(const char *
|
|
|
8fa62f |
if (!mp || !mp_len || mp_len >= PATH_MAX)
|
|
|
8fa62f |
return 0;
|
|
|
8fa62f |
|
|
|
8fa62f |
- tab = open_setmntent_r(table);
|
|
|
8fa62f |
+ tab = open_setmntent_r(_PROC_MOUNTS);
|
|
|
8fa62f |
if (!tab) {
|
|
|
8fa62f |
char *estr = strerror_r(errno, buf, PATH_MAX - 1);
|
|
|
8fa62f |
logerr("setmntent: %s", estr);
|
|
|
8fa62f |
@@ -938,7 +938,7 @@ static int table_is_mounted(const char *
|
|
|
8fa62f |
return ret;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
-static int ioctl_is_mounted(const char *table, const char *mp, unsigned int type)
|
|
|
8fa62f |
+static int ioctl_is_mounted(const char *mp, unsigned int type)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
struct ioctl_ops *ops = get_ioctl_ops();
|
|
|
8fa62f |
unsigned int mounted;
|
|
|
8fa62f |
@@ -949,7 +949,7 @@ static int ioctl_is_mounted(const char *
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
ret = ops->ismountpoint(LOGOPT_NONE, -1, mp, &mounted);
|
|
|
8fa62f |
if (ret == -1)
|
|
|
8fa62f |
- return table_is_mounted(table, mp, type);
|
|
|
8fa62f |
+ return table_is_mounted(mp, type);
|
|
|
8fa62f |
|
|
|
8fa62f |
if (mounted) {
|
|
|
8fa62f |
switch (type) {
|
|
|
8fa62f |
@@ -964,14 +964,14 @@ static int ioctl_is_mounted(const char *
|
|
|
8fa62f |
return 0;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
-int is_mounted(const char *table, const char *mp, unsigned int type)
|
|
|
8fa62f |
+int is_mounted(const char *mp, unsigned int type)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
struct ioctl_ops *ops = get_ioctl_ops();
|
|
|
8fa62f |
|
|
|
8fa62f |
if (ops->ismountpoint)
|
|
|
8fa62f |
- return ioctl_is_mounted(table, mp, type);
|
|
|
8fa62f |
+ return ioctl_is_mounted(mp, type);
|
|
|
8fa62f |
else
|
|
|
8fa62f |
- return table_is_mounted(table, mp, type);
|
|
|
8fa62f |
+ return table_is_mounted(mp, type);
|
|
|
8fa62f |
}
|
|
|
8fa62f |
|
|
|
8fa62f |
/*
|
|
|
8fa62f |
@@ -1018,7 +1018,7 @@ void tree_free_mnt_tree(struct mnt_list
|
|
|
8fa62f |
/*
|
|
|
8fa62f |
* Make tree of system mounts in /proc/mounts.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
-struct mnt_list *tree_make_mnt_tree(const char *table, const char *path)
|
|
|
8fa62f |
+struct mnt_list *tree_make_mnt_tree(const char *path)
|
|
|
8fa62f |
{
|
|
|
8fa62f |
FILE *tab;
|
|
|
8fa62f |
struct mntent mnt_wrk;
|
|
|
8fa62f |
@@ -1029,7 +1029,7 @@ struct mnt_list *tree_make_mnt_tree(cons
|
|
|
8fa62f |
size_t plen;
|
|
|
8fa62f |
int eq;
|
|
|
8fa62f |
|
|
|
8fa62f |
- tab = open_setmntent_r(table);
|
|
|
8fa62f |
+ tab = open_setmntent_r(_PROC_MOUNTS);
|
|
|
8fa62f |
if (!tab) {
|
|
|
8fa62f |
char *estr = strerror_r(errno, buf, PATH_MAX - 1);
|
|
|
8fa62f |
logerr("setmntent: %s", estr);
|
|
|
8fa62f |
@@ -1281,7 +1281,7 @@ int tree_is_mounted(struct mnt_list *mnt
|
|
|
8fa62f |
int mounted = 0;
|
|
|
8fa62f |
|
|
|
8fa62f |
if (ops->ismountpoint)
|
|
|
8fa62f |
- return ioctl_is_mounted(_PROC_MOUNTS, path, type);
|
|
|
8fa62f |
+ return ioctl_is_mounted(path, type);
|
|
|
8fa62f |
|
|
|
8fa62f |
INIT_LIST_HEAD(&list);
|
|
|
8fa62f |
|
|
|
8fa62f |
@@ -1856,7 +1856,7 @@ void set_indirect_mount_tree_catatonic(s
|
|
|
8fa62f |
struct mapent_cache *mc;
|
|
|
8fa62f |
struct mapent *me;
|
|
|
8fa62f |
|
|
|
8fa62f |
- if (!is_mounted(_PROC_MOUNTS, ap->path, MNTS_AUTOFS))
|
|
|
8fa62f |
+ if (!is_mounted(ap->path, MNTS_AUTOFS))
|
|
|
8fa62f |
return;
|
|
|
8fa62f |
|
|
|
8fa62f |
map = entry->maps;
|
|
|
8fa62f |
@@ -1920,7 +1920,7 @@ int umount_ent(struct autofs_point *ap,
|
|
|
8fa62f |
* so that we do not try to call rmdir_path on the
|
|
|
8fa62f |
* directory.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
- if (!rv && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (!rv && is_mounted(path, MNTS_REAL)) {
|
|
|
8fa62f |
crit(ap->logopt,
|
|
|
8fa62f |
"the umount binary reported that %s was "
|
|
|
8fa62f |
"unmounted, but there is still something "
|
|
|
8fa62f |
@@ -2053,7 +2053,7 @@ int mount_multi_triggers(struct autofs_p
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
if (ap->state == ST_READMAP && ap->flags & MOUNT_FLAG_REMOUNT) {
|
|
|
8fa62f |
if (oe->ioctlfd != -1 ||
|
|
|
8fa62f |
- is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
char oe_root[PATH_MAX + 1];
|
|
|
8fa62f |
strcpy(oe_root, root);
|
|
|
8fa62f |
strcat(oe_root, offset);
|
|
|
8fa62f |
@@ -2142,7 +2142,7 @@ int umount_multi_triggers(struct autofs_
|
|
|
8fa62f |
left += umount_multi_triggers(ap, oe, root, oe_base);
|
|
|
8fa62f |
|
|
|
8fa62f |
if (oe->ioctlfd != -1 ||
|
|
|
8fa62f |
- is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
left++;
|
|
|
8fa62f |
continue;
|
|
|
8fa62f |
}
|
|
|
8fa62f |
@@ -2185,10 +2185,10 @@ int umount_multi_triggers(struct autofs_
|
|
|
8fa62f |
* delete the offsets from the cache and we need to put
|
|
|
8fa62f |
* the offset triggers back.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
- if (is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (is_mounted(root, MNTS_REAL)) {
|
|
|
8fa62f |
info(ap->logopt, "unmounting dir = %s", root);
|
|
|
8fa62f |
if (umount_ent(ap, root) &&
|
|
|
8fa62f |
- is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(root, MNTS_REAL)) {
|
|
|
8fa62f |
if (mount_multi_triggers(ap, me, root, strlen(root), "/") < 0)
|
|
|
8fa62f |
warn(ap->logopt,
|
|
|
8fa62f |
"failed to remount offset triggers");
|
|
|
8fa62f |
@@ -2288,9 +2288,9 @@ int clean_stale_multi_triggers(struct au
|
|
|
8fa62f |
* ESTALE errors when attempting list the directory.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
if (oe->ioctlfd != -1 ||
|
|
|
8fa62f |
- is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
if (umount_ent(ap, oe->key) &&
|
|
|
8fa62f |
- is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
+ is_mounted(oe->key, MNTS_REAL)) {
|
|
|
8fa62f |
debug(ap->logopt,
|
|
|
8fa62f |
"offset %s has active mount, invalidate",
|
|
|
8fa62f |
oe->key);
|
|
|
8fa62f |
--- autofs-5.1.4.orig/modules/parse_amd.c
|
|
|
8fa62f |
+++ autofs-5.1.4/modules/parse_amd.c
|
|
|
8fa62f |
@@ -1173,7 +1173,7 @@ static int do_generic_mount(struct autof
|
|
|
8fa62f |
* multiple times since they are outside of
|
|
|
8fa62f |
* the automount filesystem.
|
|
|
8fa62f |
*/
|
|
|
8fa62f |
- if (!is_mounted(_PATH_MOUNTED, entry->fs, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (!is_mounted(entry->fs, MNTS_REAL)) {
|
|
|
8fa62f |
ret = do_mount(ap, entry->fs, "/", 1,
|
|
|
8fa62f |
target, entry->type, opts);
|
|
|
8fa62f |
if (ret)
|
|
|
8fa62f |
@@ -1223,7 +1223,7 @@ static int do_nfs_mount(struct autofs_po
|
|
|
8fa62f |
target, entry->type, opts,
|
|
|
8fa62f |
mount_nfs->context);
|
|
|
8fa62f |
} else {
|
|
|
8fa62f |
- if (!is_mounted(_PATH_MOUNTED, entry->fs, MNTS_REAL)) {
|
|
|
8fa62f |
+ if (!is_mounted(entry->fs, MNTS_REAL)) {
|
|
|
8fa62f |
ret = mount_nfs->mount_mount(ap, entry->fs, "/", 1,
|
|
|
8fa62f |
target, entry->type, opts,
|
|
|
8fa62f |
mount_nfs->context);
|