Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!ssharkey From: ssharkey@magnus.ircc.ohio-state.edu (Scott A Sharkey) Newsgroups: comp.os.minix Subject: BADBLOCKS 1.5 FIX Message-ID: <1991Feb18.183707.19539@magnus.ircc.ohio-state.edu> Date: 18 Feb 91 18:37:07 GMT Sender: news@magnus.ircc.ohio-state.edu Organization: The Ohio State University Lines: 43 Nntp-Posting-Host: left.magnus.ircc.ohio-state.edu Enclosed are my changes to badblocks (std PH 1.5 distribution) to correct problems handling bad blocks >8191. These changes are essentially the same as what Andy just posted from 1.6, except that I couldn't get his version to compile (probably all the posixification and V2 file system changes). Anyway, this works, and so should Andy's version. I verified with both de and fsck, on a disk which had 24 bad spots, above and below the 8K mark. -Scott *** badblocks.org Sun Feb 17 18:11:50 1991 --- badblocks.c Mon Feb 18 12:19:39 1991 *************** *** 465,475 **** unsigned z_num; char wrd_str[17], bit_str[17]; ! z_num = num + 1 - sp->s_firstdatazone; block = z_num >> BIT_MAP_SHIFT; /* which block */ offset = z_num - (block << BIT_MAP_SHIFT); /* offset in block */ ! words = offset / INT_BITS; /* which word */ blk_offset = (long) (2 + sp->s_imap_block); blk_offset *= (long) BLOCK_SIZE; --- 465,475 ---- unsigned z_num; char wrd_str[17], bit_str[17]; ! z_num = num - (sp->s_firstdatazone - 1); block = z_num >> BIT_MAP_SHIFT; /* which block */ offset = z_num - (block << BIT_MAP_SHIFT); /* offset in block */ ! words = z_num / INT_BITS; /* which word */ blk_offset = (long) (2 + sp->s_imap_block); blk_offset *= (long) BLOCK_SIZE; -- Scott Sharkey A Guest of The Ohio State University LANshark Systems 3000 Stone Mountain Dr. ssharkey@magnus.ircc.ohio-state.edu Pickerington, Ohio 43147 (614) 866-5553