Article View: net.bugs.usg
Article #18System III ialloc() bug
From: utzoodecvaxharpoutah-cssaskhssg4...
Date: Tue, 22 Mar 1983 15:42
Date: Tue, 22 Mar 1983 15:42
28 lines
1267 bytes
1267 bytes
There appears to be a bug in the ialloc() subroutine of the System III alloc.c source file. s_inode[0] is used as a "low water mark" of free inodes. It is necessary to compute the inode number "ino" for the first inode in the same block as s_inode[0]. The code used is ino = (fp->s_inode[0]&~7) + 1; This code gives an incorrect value if the s_inode[0] is the last inode of a block. The correct code is ino = ((fp->s_inode[0] - 1) & ~(INOPB-1)) + 1; (where it is assumed that INOPB is a power of 2). The effect of the bug would be to miss one free inode in the disk scan for free inodes that is done when s_inode becomes empty. Moreover, the inode is missed only if (s_inode[0] & 07) == 0. Thus, the fix is more important esthetically than practically. Darwyn Peachey Hospital Systems Study Group harpo!utah-cs!sask!hssg40!peachey OR decvax!utzoo!utcsrgv!sask!hssg40!peachey
Technical Details
Message-ID:
<bnews.hssg40.314>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!utah-cs!sask!hssg40!peachey Newsgroups: net.bugs.usg Title: System III ialloc() bug Article-I.D.: hssg40.314 Posted: Tue Mar 22 15:42:12 1983 Received: Wed Mar 23 20:02:52 1983 Subject: System III ialloc() bug Date: Tue, 22 Mar 1983 15:42:12 +0000 Message-ID: <bnews.hssg40.314>