Keep on holding lfs_lock when calling cv_broadcast

pointed out by skrll, thanks.
This commit is contained in:
maya 2017-04-01 14:53:48 +00:00
parent 9f6a52ecd2
commit 7171c6cd38

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $ */
/* $NetBSD: lfs_subr.c,v 1.88 2017/04/01 14:53:48 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.87 2017/04/01 14:43:00 maya Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.88 2017/04/01 14:53:48 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -595,9 +595,9 @@ lfs_writer_leave(struct lfs *fs)
ASSERT_MAYBE_SEGLOCK(fs);
mutex_enter(&lfs_lock);
dowakeup = !(--fs->lfs_writer);
mutex_exit(&lfs_lock);
if (dowakeup)
cv_broadcast(&fs->lfs_diropscv);
mutex_exit(&lfs_lock);
}
/*