X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fautomount.c;h=d83f3ed053aecbf4c54397160db3b5c0a827f7e3;hp=32680461c24612d61ebe15c71a0d6a2169050d66;hb=8640e111358257bbdd19582c0cac6166e87bd277;hpb=1b5601907efffd364b660bb75156b2aed49c46a4 diff --git a/src/automount.c b/src/automount.c index 32680461c..d83f3ed05 100644 --- a/src/automount.c +++ b/src/automount.c @@ -562,12 +562,15 @@ static int automount_start(Unit *u) { assert(a); + assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_MAINTAINANCE); + if (path_is_mount_point(a->where)) { log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id); return -EEXIST; } - assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_MAINTAINANCE); + if (a->mount->meta.load_state != UNIT_LOADED) + return -ENOENT; a->failure = false; automount_enter_waiting(a);