Protect lfs_order_freelist() with the segment lock.

This commit is contained in:
perseant 2006-07-06 22:27:19 +00:00
parent b8ec630ade
commit a2aa7212a8
1 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_alloc.c,v 1.94 2006/05/14 21:32:45 elad Exp $ */
/* $NetBSD: lfs_alloc.c,v 1.95 2006/07/06 22:27:19 perseant Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.94 2006/05/14 21:32:45 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.95 2006/07/06 22:27:19 perseant Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -732,6 +732,9 @@ lfs_order_freelist(struct lfs *fs)
struct buf *bp;
ino_t ino, firstino, lastino, maxino;
ASSERT_NO_SEGLOCK(fs);
lfs_seglock(fs, SEGM_PROT);
maxino = ((fs->lfs_ivnode->v_size >> fs->lfs_bshift) -
fs->lfs_cleansz - fs->lfs_segtabsz) * fs->lfs_ifpb;
fs->lfs_ino_bitmap = (lfs_bm_t *)
@ -773,4 +776,6 @@ lfs_order_freelist(struct lfs *fs)
LFS_PUT_HEADFREE(fs, cip, bp, firstino);
LFS_PUT_TAILFREE(fs, cip, bp, lastino);
lfs_segunlock(fs);
}