Fix for sync() to close a potential panic with accessing a mount struct

that had been freed.

Submitted by:	John Dyson
This commit is contained in:
David Greenman 1995-05-02 08:44:31 +00:00
parent c9c23c03fa
commit beef0195c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8219
2 changed files with 4 additions and 6 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.20 1995/03/19 11:16:58 davidg Exp $
* $Id: vfs_syscalls.c,v 1.21 1995/03/29 11:54:02 davidg Exp $
*/
#include <sys/param.h>
@ -322,8 +322,7 @@ sync(p, uap, retval)
register struct mount *mp, *nmp;
int asyncflag;
for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) {
nmp = mp->mnt_list.tqe_next;
for (mp = mountlist.tqh_first; mp != NULL; mp = mp->mnt_list.tqe_next) {
/*
* The lock check below is to avoid races with mount
* and unmount.

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.20 1995/03/19 11:16:58 davidg Exp $
* $Id: vfs_syscalls.c,v 1.21 1995/03/29 11:54:02 davidg Exp $
*/
#include <sys/param.h>
@ -322,8 +322,7 @@ sync(p, uap, retval)
register struct mount *mp, *nmp;
int asyncflag;
for (mp = mountlist.tqh_first; mp != NULL; mp = nmp) {
nmp = mp->mnt_list.tqe_next;
for (mp = mountlist.tqh_first; mp != NULL; mp = mp->mnt_list.tqe_next) {
/*
* The lock check below is to avoid races with mount
* and unmount.