Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!mcvax!botter!ark!polder From: polder@ark.UUCP Newsgroups: comp.os.minix Subject: portablity bug in mkfs. Message-ID: <956@ark.cs.vu.nl> Date: Fri, 3-Apr-87 17:08:57 EST Article-I.D.: ark.956 Posted: Fri Apr 3 17:08:57 1987 Date-Received: Sun, 5-Apr-87 07:08:18 EST Reply-To: polder@cs.vu.nl (Paul Polderman) Distribution: world Organization: VU Informatica, Amsterdam Lines: 29 Keywords: mkfs Sender: When mkfs is compiled on a system where sizeof(int) is not 2 bytes, (e.g. a VAX) mkfs will build a wrong filesystem when using indirect blocks. The code assumes there are INTS_PER_BLOCK zone numbers per indirect block, where it should be NR_INDIRECTS. Consequently, on e.g. a VAX, every even zone number on the block will be zero (== NO_ZONE). The following diff-listing should solve this. ------------------------------------------------- 32a33,34 > #undef major /* These defines are used as variables in the code */ > #undef minor 448c450,451 < int b, off, blk[INTS_PER_BLOCK], indir, i; --- > int b, off, indir, i; > zone_nr blk[NR_INDIRECTS]; 472c475 < for (i = 0; i < INTS_PER_BLOCK; i++) --- > for (i = 0; i < NR_INDIRECTS; i++) 474c477 < blk[i] = z; --- > blk[i] = (zone_nr) z; ------------------------------------------------- Paul Polderman (polder@cs.vu.nl)