Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/autofs/autounmountd.c
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | log_debugx("lost filesystem mounted on %s (FSID:%d:%d)", | ||||
af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1]); | af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1]); | ||||
automounted_remove(af); | automounted_remove(af); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
unmount_by_fsid(const fsid_t fsid, const char *mountpoint) | unmount_by_fsid(const fsid_t fsid, const char *mountpoint) | ||||
{ | { | ||||
char *fsid_str; | int error; | ||||
int error, ret; | |||||
ret = asprintf(&fsid_str, "FSID:%d:%d", fsid.val[0], fsid.val[1]); | if ((error = unmount_automount(&fsid, MNT_NONBUSY)) != 0) | ||||
if (ret < 0) | log_warn("cannot unmount %s (FSID:%d:%d)", | ||||
log_err(1, "asprintf"); | mountpoint, fsid.val[0], fsid.val[1]); | ||||
error = unmount(fsid_str, MNT_NONBUSY | MNT_BYFSID); | |||||
if (error != 0) { | |||||
if (errno == EBUSY) { | |||||
log_debugx("cannot unmount %s (%s): %s", | |||||
mountpoint, fsid_str, strerror(errno)); | |||||
} else { | |||||
log_warn("cannot unmount %s (%s)", | |||||
mountpoint, fsid_str); | |||||
} | |||||
} | |||||
free(fsid_str); | |||||
return (error); | return (error); | ||||
} | } | ||||
static time_t | static time_t | ||||
expire_automounted(time_t expiration_time) | expire_automounted(time_t expiration_time) | ||||
{ | { | ||||
struct automounted_fs *af, *tmpaf; | struct automounted_fs *af, *tmpaf; | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |