From owner-freebsd-current Sun Dec 24 22:01:26 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA03608 for current-outgoing; Sun, 24 Dec 1995 22:01:26 -0800 (PST) Received: from marble.eps.nagoya-u.ac.jp (marble.eps.nagoya-u.ac.jp [133.6.57.68]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id WAA03603 for ; Sun, 24 Dec 1995 22:01:15 -0800 (PST) Received: from marble.eps.nagoya-u.ac.jp (localhost [127.0.0.1]) by marble.eps.nagoya-u.ac.jp (8.7.1+2.6Wbeta4/3.3W9) with ESMTP id PAA03702 for ; Mon, 25 Dec 1995 15:01:09 +0900 (JST) Message-Id: <199512250601.PAA03702@marble.eps.nagoya-u.ac.jp> To: current@FreeBSD.ORG Subject: Re: return value of ffs_blkpref() In-Reply-To: Your message of "Sun, 24 Dec 1995 16:08:18 +0900" References: <199512240708.QAA00452@marble.eps.nagoya-u.ac.jp> X-Mailer: Mew beta version 0.96 on Emacs 19.28.1, Mule 2.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Mon, 25 Dec 1995 15:01:06 +0900 From: KATO Takenori Sender: owner-current@FreeBSD.ORG Precedence: bulk On 24 Dec 1995, I wrote: > But ffs_clusteralloc doesn't check pref is correct or not. One of the solution of this problem is as follows: *** ffs_alloc.c.orig Mon Dec 25 14:53:59 1995 --- ffs_alloc.c Mon Dec 25 14:56:22 1995 *************** *** 1058,1065 **** */ if (dtog(fs, bpref) != cg) bpref = 0; ! else ! bpref = fragstoblks(fs, dtogd(fs, blknum(fs, bpref))); mapp = &cg_clustersfree(cgp)[bpref / NBBY]; map = *mapp++; bit = 1 << (bpref % NBBY); --- 1058,1069 ---- */ if (dtog(fs, bpref) != cg) bpref = 0; ! else { ! if (bpref >= fs->fs_size) ! bpref = 0; ! else ! bpref = fragstoblks(fs, dtogd(fs, blknum(fs, bpref))); ! } mapp = &cg_clustersfree(cgp)[bpref / NBBY]; map = *mapp++; bit = 1 << (bpref % NBBY); ---- KATO Takenori Dept. Earth Planet. Sci., Nagoya Univ., Nagoya 464-01 Voice: +81-52-789-2529 Fax: +81-52-789-3033