(from mycroft)
SCCS-vsn: sys/kern/vfs_syscalls.c 8.21
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)vfs_syscalls.c 8.20 (Berkeley) %G%
+ * @(#)vfs_syscalls.c 8.21 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
int asyncflag;
for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) {
int asyncflag;
for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) {
+ /*
+ * Get the next pointer in case we hang on vfs_busy
+ * while we are being unmounted.
+ */
nmp = mp->mnt_list.tqe_next;
/*
* The lock check below is to avoid races with mount
nmp = mp->mnt_list.tqe_next;
/*
* The lock check below is to avoid races with mount
VFS_SYNC(mp, MNT_NOWAIT, p->p_ucred, p);
if (asyncflag)
mp->mnt_flag |= MNT_ASYNC;
VFS_SYNC(mp, MNT_NOWAIT, p->p_ucred, p);
if (asyncflag)
mp->mnt_flag |= MNT_ASYNC;
+ /*
+ * Get the next pointer again, as the next filesystem
+ * might have been unmounted while we were sync'ing.
+ */
+ nmp = mp->mnt_list.tqe_next;