Path: utzoo!attcan!uunet!lll-winken!ames!ncar!gatech!hubcap!ncrcae!sauron!wescott From: wescott@sauron.Columbia.NCR.COM (Mike Wescott) Newsgroups: comp.bugs.sys5 Subject: Re: Free inode-list exhaustion Message-ID: <1525@sauron.Columbia.NCR.COM> Date: 17 Jan 89 15:37:59 GMT References: <778@sl10c.concurrent.co.uk> Reply-To: wescott@sauron.Columbia.NCR.COM (Mike Wescott) Organization: Entry Level Systems Development, NCR Corp., Columbia, SC Lines: 47 In article <778@sl10c.concurrent.co.uk> Alan Young writes: > Some time ago (about a year) there was considerable discussion about a > problem with exhaustion of the free-inode list of a mounted file system. > This was most commonly observed on file systems supporting Usenet News. > As I recall the basis of the problem was a flaw in the algorithm for > refreshing the in-core free list from the disk and that this was only > exercised on file systems with a high turnover of inodes. Correct. The following diff should be of some help. Your line numbers will certainly not be the same. The fix shown here is to rescan the whole inode list whenever it runs out. The code fragments are from a V.2.2 port with the fix vs V.2.2 for the VAX. *** /tmp/alloc.c.orig Tue Jan 17 10:28:36 1989 --- /tmp/alloc.c Tue Jan 17 10:28:07 1989 *************** *** 187,192 **** --- 231,238 ---- goto loop; } fp->s_ilock++; + + again: /* come back here if necessary to re-search from beginning */ fp->s_ninode = NICINOD; ino = FsINOS(dev, fp->s_inode[0]); for(adr = FsITOD(dev, ino); adr < fp->s_isize; adr++) { *************** *** 207,212 **** --- 253,267 ---- if (fp->s_ninode <= 0) break; } + /* + * If we didn't find any and we didn't start at the beginning, + * look again starting at the beginning + */ + if (fp->s_ninode == NICINOD && fp->s_inode[0] != 0) { + fp->s_inode[0] = 0; + goto again; + } + fp->s_ilock = 0; wakeup((caddr_t)&fp->s_ilock); if (fp->s_ninode > 0) { -- -Mike Wescott mike.wescott@ncrcae.Columbia.NCR.COM