Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2002 14:24:58 -0700 (PDT)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/ufs/ffs ffs_alloc.c
Message-ID:  <200206222124.g5MLOw243907@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
mckusick    2002/06/22 14:24:58 PDT

  Modified files:
    sys/ufs/ffs          ffs_alloc.c 
  Log:
  This patch fixes a problem whereby filesystems that ran
  out of inodes in a cylinder group would fail to check for
  free inodes in other cylinder groups. This bug was introduced
  in the UFS2 code merge two days ago.
  
  An inode is allocated by calling ffs_valloc which calls
  ffs_hashalloc to do the filesystem scan. Ffs_hashalloc
  walks around the cylinder groups calling its passed allocator
  (ffs_nodealloccg in this case) until the allocator returns a
  non-zero result. The bug is that ffs_hashalloc expects the
  passed allocator function to return a 64-bit ufs2_daddr_t.
  When allocating inodes, it calls ffs_nodealloccg which was
  returning a 32-bit ino_t. The ffs_hashalloc code checked
  a 64-bit return value and usually found random non-zero bits in
  the high 32-bits so decided that the allocation had succeeded
  (in this case in the only cylinder group that it checked).
  When the result was passed back to ffs_valloc it looked at
  only the bottom 32-bits, saw zero and declared the system
  out of inodes. But ffs_hashalloc had really only checked
  one cylinder group.
  
  The fix is to change ffs_nodealloccg to return 64-bit results.
  
  Sponsored by:   DARPA & NAI Labs.
  Submitted by:   Poul-Henning Kamp <phk@critter.freebsd.dk>
  Reviewed by:    Maxime Henrion <mux@freebsd.org>
  
  Revision  Changes    Path
  1.94      +2 -2      src/sys/ufs/ffs/ffs_alloc.c

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206222124.g5MLOw243907>