|
|
96dc52 |
autofs-5.1.7 - switch to use tree implementation for offsets
|
|
|
96dc52 |
|
|
|
96dc52 |
From: Ian Kent <raven@themaw.net>
|
|
|
96dc52 |
|
|
|
96dc52 |
Change to use the tree mapent implementation for the handling
|
|
|
96dc52 |
of offset mounts.
|
|
|
96dc52 |
|
|
|
96dc52 |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
96dc52 |
---
|
|
|
96dc52 |
CHANGELOG | 1
|
|
|
96dc52 |
daemon/automount.c | 25 ++----------
|
|
|
96dc52 |
daemon/lookup.c | 2 -
|
|
|
96dc52 |
include/automount.h | 8 ++--
|
|
|
96dc52 |
lib/cache.c | 67 ---------------------------------
|
|
|
96dc52 |
lib/mounts.c | 4 +-
|
|
|
96dc52 |
modules/lookup_program.c | 2 -
|
|
|
96dc52 |
modules/parse_sun.c | 94 ++++++++++++----------------------------------
|
|
|
96dc52 |
8 files changed, 39 insertions(+), 164 deletions(-)
|
|
|
96dc52 |
|
|
|
96dc52 |
diff --git a/CHANGELOG b/CHANGELOG
|
|
|
96dc52 |
index 892f7581..5ac09f77 100644
|
|
|
96dc52 |
--- a/CHANGELOG
|
|
|
96dc52 |
+++ b/CHANGELOG
|
|
|
96dc52 |
@@ -40,6 +40,7 @@
|
|
|
96dc52 |
- add tree_mapent_cleanup_offsets().
|
|
|
96dc52 |
- add set_offset_tree_catatonic().
|
|
|
96dc52 |
- add mount and umount offsets functions.
|
|
|
96dc52 |
+- switch to use tree implementation for offsets.
|
|
|
96dc52 |
|
|
|
96dc52 |
25/01/2021 autofs-5.1.7
|
|
|
96dc52 |
- make bind mounts propagation slave by default.
|
|
|
96dc52 |
diff --git a/daemon/automount.c b/daemon/automount.c
|
|
|
96dc52 |
index f4608fc9..7833dfae 100644
|
|
|
96dc52 |
--- a/daemon/automount.c
|
|
|
96dc52 |
+++ b/daemon/automount.c
|
|
|
96dc52 |
@@ -551,29 +551,15 @@ static int umount_subtree_mounts(struct autofs_point *ap, const char *path, unsi
|
|
|
96dc52 |
left = 0;
|
|
|
96dc52 |
|
|
|
96dc52 |
if (me && IS_MM(me)) {
|
|
|
96dc52 |
- char root[PATH_MAX + 1];
|
|
|
96dc52 |
char key[PATH_MAX + 1];
|
|
|
96dc52 |
struct mapent *tmp;
|
|
|
96dc52 |
- int status;
|
|
|
96dc52 |
- char *base;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (!strchr(MM_ROOT(me)->key, '/'))
|
|
|
96dc52 |
- /* Indirect multi-mount root */
|
|
|
96dc52 |
- /* sprintf okay - if it's mounted, it's
|
|
|
96dc52 |
- * PATH_MAX or less bytes */
|
|
|
96dc52 |
- sprintf(root, "%s/%s", ap->path, MM_ROOT(me)->key);
|
|
|
96dc52 |
- else
|
|
|
96dc52 |
- strcpy(root, MM_ROOT(me)->key);
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (IS_MM_ROOT(me))
|
|
|
96dc52 |
- base = NULL;
|
|
|
96dc52 |
- else
|
|
|
96dc52 |
- base = me->key + strlen(root);
|
|
|
96dc52 |
+ int ret;
|
|
|
96dc52 |
|
|
|
96dc52 |
- left = umount_multi_triggers(ap, me, root, base);
|
|
|
96dc52 |
- if (left) {
|
|
|
96dc52 |
+ ret = tree_mapent_umount_offsets(me, 1);
|
|
|
96dc52 |
+ if (!ret) {
|
|
|
96dc52 |
warn(ap->logopt,
|
|
|
96dc52 |
"some offset mounts still present under %s", path);
|
|
|
96dc52 |
+ left++;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
strcpy(key, me->key);
|
|
|
96dc52 |
@@ -589,8 +575,7 @@ static int umount_subtree_mounts(struct autofs_point *ap, const char *path, unsi
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
if (!left && IS_MM_ROOT(me)) {
|
|
|
96dc52 |
- status = cache_delete_offset_list(mc, me->key);
|
|
|
96dc52 |
- if (status != CHE_OK) {
|
|
|
96dc52 |
+ if (!tree_mapent_delete_offsets(mc, me->key)) {
|
|
|
96dc52 |
warn(ap->logopt, "couldn't delete offset list");
|
|
|
96dc52 |
left++;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
diff --git a/daemon/lookup.c b/daemon/lookup.c
|
|
|
96dc52 |
index 5116b927..32dbc24d 100644
|
|
|
96dc52 |
--- a/daemon/lookup.c
|
|
|
96dc52 |
+++ b/daemon/lookup.c
|
|
|
96dc52 |
@@ -843,7 +843,7 @@ static int lookup_amd_instance(struct autofs_point *ap,
|
|
|
96dc52 |
return NSS_STATUS_UNKNOWN;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
- m_key = malloc(ap->len + strlen(MM_ROOT(me)->key) + 2);
|
|
|
96dc52 |
+ m_key = malloc(ap->len + MM_ROOT(me)->len + 2);
|
|
|
96dc52 |
if (!m_key) {
|
|
|
96dc52 |
error(ap->logopt,
|
|
|
96dc52 |
"failed to allocate storage for search key");
|
|
|
96dc52 |
diff --git a/include/automount.h b/include/automount.h
|
|
|
96dc52 |
index f6023e27..a71b8674 100644
|
|
|
96dc52 |
--- a/include/automount.h
|
|
|
96dc52 |
+++ b/include/automount.h
|
|
|
96dc52 |
@@ -187,10 +187,10 @@ struct mapent {
|
|
|
96dc52 |
ino_t ino;
|
|
|
96dc52 |
};
|
|
|
96dc52 |
|
|
|
96dc52 |
-#define IS_MM(me) (me->multi)
|
|
|
96dc52 |
-#define IS_MM_ROOT(me) (me->multi == me)
|
|
|
96dc52 |
-#define MM_ROOT(me) (me->multi)
|
|
|
96dc52 |
-#define MM_PARENT(me) (me->parent)
|
|
|
96dc52 |
+#define IS_MM(me) (me->mm_root)
|
|
|
96dc52 |
+#define IS_MM_ROOT(me) (me->mm_root == &me->node)
|
|
|
96dc52 |
+#define MM_ROOT(me) (MAPENT(me->mm_root))
|
|
|
96dc52 |
+#define MM_PARENT(me) (MAPENT(me->mm_parent))
|
|
|
96dc52 |
|
|
|
96dc52 |
void cache_lock_cleanup(void *arg);
|
|
|
96dc52 |
void cache_readlock(struct mapent_cache *mc);
|
|
|
96dc52 |
diff --git a/lib/cache.c b/lib/cache.c
|
|
|
96dc52 |
index 7c409a56..93b02daf 100644
|
|
|
96dc52 |
--- a/lib/cache.c
|
|
|
96dc52 |
+++ b/lib/cache.c
|
|
|
96dc52 |
@@ -682,14 +682,6 @@ int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *k
|
|
|
96dc52 |
return CHE_FAIL;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
- me = cache_lookup_distinct(mc, key);
|
|
|
96dc52 |
- if (me) {
|
|
|
96dc52 |
- cache_add_ordered_offset(me, &owner->multi_list);
|
|
|
96dc52 |
- MM_ROOT(me) = owner;
|
|
|
96dc52 |
- goto done;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
- ret = CHE_FAIL;
|
|
|
96dc52 |
-done:
|
|
|
96dc52 |
return ret;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
@@ -958,65 +950,6 @@ done:
|
|
|
96dc52 |
return ret;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
-/* cache must be write locked by caller */
|
|
|
96dc52 |
-int cache_delete_offset_list(struct mapent_cache *mc, const char *key)
|
|
|
96dc52 |
-{
|
|
|
96dc52 |
- unsigned logopt = mc->ap ? mc->ap->logopt : master_get_logopt();
|
|
|
96dc52 |
- struct mapent *me;
|
|
|
96dc52 |
- struct mapent *this;
|
|
|
96dc52 |
- struct list_head *head, *next;
|
|
|
96dc52 |
- int remain = 0;
|
|
|
96dc52 |
- int status;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- me = cache_lookup_distinct(mc, key);
|
|
|
96dc52 |
- if (!me)
|
|
|
96dc52 |
- return CHE_FAIL;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- /* Not offset list owner */
|
|
|
96dc52 |
- if (!IS_MM_ROOT(me))
|
|
|
96dc52 |
- return CHE_FAIL;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- head = &me->multi_list;
|
|
|
96dc52 |
- next = head->next;
|
|
|
96dc52 |
- while (next != head) {
|
|
|
96dc52 |
- this = list_entry(next, struct mapent, multi_list);
|
|
|
96dc52 |
- next = next->next;
|
|
|
96dc52 |
- if (this->ioctlfd != -1) {
|
|
|
96dc52 |
- error(logopt,
|
|
|
96dc52 |
- "active offset mount key %s", this->key);
|
|
|
96dc52 |
- return CHE_FAIL;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- head = &me->multi_list;
|
|
|
96dc52 |
- next = head->next;
|
|
|
96dc52 |
- while (next != head) {
|
|
|
96dc52 |
- this = list_entry(next, struct mapent, multi_list);
|
|
|
96dc52 |
- next = next->next;
|
|
|
96dc52 |
- list_del_init(&this->multi_list);
|
|
|
96dc52 |
- MM_ROOT(this) = NULL;
|
|
|
96dc52 |
- debug(logopt, "deleting offset key %s", this->key);
|
|
|
96dc52 |
- status = cache_delete(mc, this->key);
|
|
|
96dc52 |
- if (status == CHE_FAIL) {
|
|
|
96dc52 |
- warn(logopt,
|
|
|
96dc52 |
- "failed to delete offset %s", this->key);
|
|
|
96dc52 |
- MM_ROOT(this) = me;
|
|
|
96dc52 |
- /* TODO: add list back in */
|
|
|
96dc52 |
- remain++;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (!remain) {
|
|
|
96dc52 |
- list_del_init(&me->multi_list);
|
|
|
96dc52 |
- MM_ROOT(me) = NULL;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (remain)
|
|
|
96dc52 |
- return CHE_FAIL;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- return CHE_OK;
|
|
|
96dc52 |
-}
|
|
|
96dc52 |
-
|
|
|
96dc52 |
void cache_release(struct map_source *map)
|
|
|
96dc52 |
{
|
|
|
96dc52 |
struct mapent_cache *mc;
|
|
|
96dc52 |
diff --git a/lib/mounts.c b/lib/mounts.c
|
|
|
96dc52 |
index f7c29475..6ca7eff1 100644
|
|
|
96dc52 |
--- a/lib/mounts.c
|
|
|
96dc52 |
+++ b/lib/mounts.c
|
|
|
96dc52 |
@@ -2893,7 +2893,7 @@ void set_indirect_mount_tree_catatonic(struct autofs_point *ap)
|
|
|
96dc52 |
|
|
|
96dc52 |
/* Only need to set offset mounts catatonic */
|
|
|
96dc52 |
if (IS_MM(me) && IS_MM_ROOT(me))
|
|
|
96dc52 |
- set_multi_mount_tree_catatonic(ap, me);
|
|
|
96dc52 |
+ set_offset_tree_catatonic(ap, me);
|
|
|
96dc52 |
next:
|
|
|
96dc52 |
me = cache_enumerate(mc, me);
|
|
|
96dc52 |
}
|
|
|
96dc52 |
@@ -2913,7 +2913,7 @@ void set_direct_mount_tree_catatonic(struct autofs_point *ap, struct mapent *me)
|
|
|
96dc52 |
{
|
|
|
96dc52 |
/* Set offset mounts catatonic for this mapent */
|
|
|
96dc52 |
if (IS_MM(me) && IS_MM_ROOT(me))
|
|
|
96dc52 |
- set_multi_mount_tree_catatonic(ap, me);
|
|
|
96dc52 |
+ set_offset_tree_catatonic(ap, me);
|
|
|
96dc52 |
set_mount_catatonic(ap, me, me->ioctlfd);
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
diff --git a/modules/lookup_program.c b/modules/lookup_program.c
|
|
|
96dc52 |
index 70f27545..6cab52c8 100644
|
|
|
96dc52 |
--- a/modules/lookup_program.c
|
|
|
96dc52 |
+++ b/modules/lookup_program.c
|
|
|
96dc52 |
@@ -658,7 +658,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
|
|
|
96dc52 |
me = cache_lookup_distinct(mc, name);
|
|
|
96dc52 |
if (me) {
|
|
|
96dc52 |
if (IS_MM(me))
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
+ tree_mapent_delete_offsets(mc, name);
|
|
|
96dc52 |
cache_delete(mc, name);
|
|
|
96dc52 |
}
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
|
|
|
96dc52 |
index b1f64ca0..d6ef48b8 100644
|
|
|
96dc52 |
--- a/modules/parse_sun.c
|
|
|
96dc52 |
+++ b/modules/parse_sun.c
|
|
|
96dc52 |
@@ -854,8 +854,8 @@ update_offset_entry(struct autofs_point *ap,
|
|
|
96dc52 |
cache_writelock(mc);
|
|
|
96dc52 |
ret = cache_update_offset(mc, name, m_key, m_mapent, age);
|
|
|
96dc52 |
|
|
|
96dc52 |
- if (!cache_set_offset_parent(mc, m_key))
|
|
|
96dc52 |
- error(ap->logopt, "failed to set offset parent");
|
|
|
96dc52 |
+ if (!tree_mapent_add_node(mc, name, m_key))
|
|
|
96dc52 |
+ error(ap->logopt, "failed to add offset %s to tree", m_key);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
|
|
|
96dc52 |
if (ret == CHE_DUPLICATE) {
|
|
|
96dc52 |
@@ -1134,10 +1134,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
const char *name, char *loc, char *options, void *ctxt)
|
|
|
96dc52 |
{
|
|
|
96dc52 |
struct mapent *me;
|
|
|
96dc52 |
- struct mapent *ro;
|
|
|
96dc52 |
- char *mm_root, *mm_base, *mm_key;
|
|
|
96dc52 |
- unsigned int mm_root_len;
|
|
|
96dc52 |
- int start, ret = 0, rv;
|
|
|
96dc52 |
+ int ret = 0, rv;
|
|
|
96dc52 |
|
|
|
96dc52 |
cache_readlock(mc);
|
|
|
96dc52 |
me = cache_lookup_distinct(mc, name);
|
|
|
96dc52 |
@@ -1148,34 +1145,18 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
|
|
|
96dc52 |
rv = 0;
|
|
|
96dc52 |
|
|
|
96dc52 |
- mm_key = MM_ROOT(me)->key;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (*mm_key == '/') {
|
|
|
96dc52 |
- mm_root = mm_key;
|
|
|
96dc52 |
- start = strlen(mm_key);
|
|
|
96dc52 |
- } else {
|
|
|
96dc52 |
- start = ap->len + strlen(mm_key) + 1;
|
|
|
96dc52 |
- mm_root = alloca(start + 3);
|
|
|
96dc52 |
- strcpy(mm_root, ap->path);
|
|
|
96dc52 |
- strcat(mm_root, "/");
|
|
|
96dc52 |
- strcat(mm_root, mm_key);
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
- mm_root_len = strlen(mm_root);
|
|
|
96dc52 |
-
|
|
|
96dc52 |
if (IS_MM_ROOT(me)) {
|
|
|
96dc52 |
char key[PATH_MAX + 1];
|
|
|
96dc52 |
+ struct mapent *ro;
|
|
|
96dc52 |
+ size_t len;
|
|
|
96dc52 |
|
|
|
96dc52 |
- if (mm_root_len + 1 > PATH_MAX) {
|
|
|
96dc52 |
+ len = mount_fullpath(key, PATH_MAX, ap->path, me->key);
|
|
|
96dc52 |
+ if (!len) {
|
|
|
96dc52 |
warn(ap->logopt, "path loo long");
|
|
|
96dc52 |
return 1;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- /* name = NULL */
|
|
|
96dc52 |
- /* destination = mm_root */
|
|
|
96dc52 |
- mm_base = "/";
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- strcpy(key, mm_root);
|
|
|
96dc52 |
- strcat(key, mm_base);
|
|
|
96dc52 |
+ key[len] = '/';
|
|
|
96dc52 |
+ key[len + 1] = 0;
|
|
|
96dc52 |
|
|
|
96dc52 |
/* Mount root offset if it exists */
|
|
|
96dc52 |
ro = cache_lookup_distinct(me->mc, key);
|
|
|
96dc52 |
@@ -1194,7 +1175,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
warn(ap->logopt,
|
|
|
96dc52 |
MODPREFIX "failed to parse root offset");
|
|
|
96dc52 |
cache_writelock(mc);
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
+ tree_mapent_delete_offsets(mc, name);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
return 1;
|
|
|
96dc52 |
}
|
|
|
96dc52 |
@@ -1209,10 +1190,10 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
free(ro_loc);
|
|
|
96dc52 |
}
|
|
|
96dc52 |
|
|
|
96dc52 |
- if ((ro && rv == 0) || rv <= 0) {
|
|
|
96dc52 |
- ret = mount_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
|
96dc52 |
- if (ret == -1) {
|
|
|
96dc52 |
- cleanup_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
|
96dc52 |
+ if (rv <= 0) {
|
|
|
96dc52 |
+ ret = tree_mapent_mount_offsets(me, 1);
|
|
|
96dc52 |
+ if (!ret) {
|
|
|
96dc52 |
+ tree_mapent_cleanup_offsets(me);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
error(ap->logopt, MODPREFIX
|
|
|
96dc52 |
"failed to mount offset triggers");
|
|
|
96dc52 |
@@ -1223,39 +1204,14 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
int loclen = strlen(loc);
|
|
|
96dc52 |
int namelen = strlen(name);
|
|
|
96dc52 |
|
|
|
96dc52 |
- /* name = mm_root + mm_base */
|
|
|
96dc52 |
- /* destination = mm_root + mm_base = name */
|
|
|
96dc52 |
- mm_base = &me->key[start];
|
|
|
96dc52 |
-
|
|
|
96dc52 |
+ /* Mounts at nesting points must succeed for subtree
|
|
|
96dc52 |
+ * offsets to be mounted.
|
|
|
96dc52 |
+ */
|
|
|
96dc52 |
rv = sun_mount(ap, name, name, namelen, loc, loclen, options, ctxt);
|
|
|
96dc52 |
if (rv == 0) {
|
|
|
96dc52 |
- ret = mount_multi_triggers(ap, me->multi, name, start, mm_base);
|
|
|
96dc52 |
- if (ret == -1) {
|
|
|
96dc52 |
- cleanup_multi_triggers(ap, me, name, start, mm_base);
|
|
|
96dc52 |
- cache_unlock(mc);
|
|
|
96dc52 |
- error(ap->logopt, MODPREFIX
|
|
|
96dc52 |
- "failed to mount offset triggers");
|
|
|
96dc52 |
- return 1;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
- } else if (rv < 0) {
|
|
|
96dc52 |
- char mm_root_base[PATH_MAX + 1];
|
|
|
96dc52 |
- unsigned int mm_root_base_len = mm_root_len + strlen(mm_base) + 1;
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- if (mm_root_base_len > PATH_MAX) {
|
|
|
96dc52 |
- cache_unlock(mc);
|
|
|
96dc52 |
- warn(ap->logopt, MODPREFIX "path too long");
|
|
|
96dc52 |
- cache_writelock(mc);
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
- cache_unlock(mc);
|
|
|
96dc52 |
- return 1;
|
|
|
96dc52 |
- }
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- strcpy(mm_root_base, mm_root);
|
|
|
96dc52 |
- strcat(mm_root_base, mm_base);
|
|
|
96dc52 |
-
|
|
|
96dc52 |
- ret = mount_multi_triggers(ap, me->multi, mm_root_base, start, mm_base);
|
|
|
96dc52 |
- if (ret == -1) {
|
|
|
96dc52 |
- cleanup_multi_triggers(ap, me, mm_root, start, mm_base);
|
|
|
96dc52 |
+ ret = tree_mapent_mount_offsets(me, 1);
|
|
|
96dc52 |
+ if (!ret) {
|
|
|
96dc52 |
+ tree_mapent_cleanup_offsets(me);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
error(ap->logopt, MODPREFIX
|
|
|
96dc52 |
"failed to mount offset triggers");
|
|
|
96dc52 |
@@ -1265,7 +1221,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent_cache *mc,
|
|
|
96dc52 |
}
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
|
|
|
96dc52 |
- /* Mount for base of tree failed */
|
|
|
96dc52 |
+ /* strict mount failed */
|
|
|
96dc52 |
if (rv > 0)
|
|
|
96dc52 |
return rv;
|
|
|
96dc52 |
|
|
|
96dc52 |
@@ -1506,7 +1462,7 @@ dont_expand:
|
|
|
96dc52 |
|
|
|
96dc52 |
/* So we know we're the multi-mount root */
|
|
|
96dc52 |
if (!IS_MM(me))
|
|
|
96dc52 |
- me->multi = me;
|
|
|
96dc52 |
+ MAPENT_SET_ROOT(me, tree_mapent_root(me))
|
|
|
96dc52 |
else {
|
|
|
96dc52 |
/*
|
|
|
96dc52 |
* The amd host mount type assumes the lookup name
|
|
|
96dc52 |
@@ -1556,7 +1512,7 @@ dont_expand:
|
|
|
96dc52 |
if (!m_offset) {
|
|
|
96dc52 |
warn(ap->logopt, MODPREFIX "null path or out of memory");
|
|
|
96dc52 |
cache_writelock(mc);
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
+ tree_mapent_delete_offsets(mc, name);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
free(options);
|
|
|
96dc52 |
free(pmapent);
|
|
|
96dc52 |
@@ -1573,7 +1529,7 @@ dont_expand:
|
|
|
96dc52 |
l = parse_mapent(p, options, &myoptions, &loc, ap->logopt);
|
|
|
96dc52 |
if (!l) {
|
|
|
96dc52 |
cache_writelock(mc);
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
+ tree_mapent_delete_offsets(mc, name);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
free(m_offset);
|
|
|
96dc52 |
free(options);
|
|
|
96dc52 |
@@ -1592,7 +1548,7 @@ dont_expand:
|
|
|
96dc52 |
if (status != CHE_OK) {
|
|
|
96dc52 |
warn(ap->logopt, MODPREFIX "error adding multi-mount");
|
|
|
96dc52 |
cache_writelock(mc);
|
|
|
96dc52 |
- cache_delete_offset_list(mc, name);
|
|
|
96dc52 |
+ tree_mapent_delete_offsets(mc, name);
|
|
|
96dc52 |
cache_unlock(mc);
|
|
|
96dc52 |
free(m_offset);
|
|
|
96dc52 |
free(options);
|