Free inode-list exhaustion

Mike Wescott wescott at sauron.Columbia.NCR.COM
Wed Jan 18 01:37:59 AEST 1989


In article <778 at sl10c.concurrent.co.uk> Alan Young <awy at concurrent.co.uk> 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 at ncrcae.Columbia.NCR.COM



More information about the Comp.bugs.sys5 mailing list