Fix errors unmounting remote systems which don't understand RPC_UMNTALL.
Submitted by: Martin Blapp <mblapp@kassiopeja.lan.attic.ch>
This commit is contained in:
parent
ed0bfbe5c7
commit
10cb4f4a62
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54341
@ -81,7 +81,7 @@ Keep entries for existing NFS filesystems. Compare the NFS filesystems from
|
||||
the mounttab against the kernel mountlist and do not send the RPC to
|
||||
existing mount entries. Useful during startup of the system. It may be
|
||||
possible that there are already mounted NFS filesystems, so calling
|
||||
RPC UMNTALL isn't a good idea. This is the case if the user has rebooted
|
||||
RPC UMOUNT isn't a good idea. This is the case if the user has rebooted
|
||||
to 'single user mode' and starts up the system again.
|
||||
.It Fl p Ar path
|
||||
Only remove the specific mount-path. Send a UMOUNT RPC to the NFS server.
|
||||
|
@ -110,9 +110,8 @@ main(int argc, char **argv) {
|
||||
PATH_MOUNTTAB);
|
||||
}
|
||||
for (mtab = mtabhead; mtab != NULL; mtab = mtab->mtab_next) {
|
||||
if (*mtab->mtab_host != '\0' &&
|
||||
(do_umntall(mtab->mtab_host) ||
|
||||
mtab->mtab_time <= (time(now) - expire))) {
|
||||
if (*mtab->mtab_host != '\0' ||
|
||||
mtab->mtab_time <= (time(now) - expire)) {
|
||||
if (keep && is_mounted(mtab->mtab_host,
|
||||
mtab->mtab_dirp)) {
|
||||
if (verbose) {
|
||||
@ -120,8 +119,11 @@ main(int argc, char **argv) {
|
||||
mtab->mtab_host,
|
||||
mtab->mtab_dirp);
|
||||
}
|
||||
} else
|
||||
clean_mtab(mtab->mtab_host, NULL);
|
||||
} else if (do_umount(mtab->mtab_host,
|
||||
mtab->mtab_dirp)) {
|
||||
clean_mtab(mtab->mtab_host,
|
||||
mtab->mtab_dirp);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Only do a RPC UMNTALL for this specific host */
|
||||
@ -162,6 +164,8 @@ main(int argc, char **argv) {
|
||||
|
||||
/*
|
||||
* Send a RPC_MNT UMNTALL request to hostname.
|
||||
* XXX This works for all mountd implementations,
|
||||
* but produces a RPC IOERR on non FreeBSD systems.
|
||||
*/
|
||||
int
|
||||
do_umntall(char *hostname) {
|
||||
|
Loading…
Reference in New Issue
Block a user