DragonFly BSD
DragonFly commits List (threaded) for 2004-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

cvs commit: src/sys/vfs/ufs ffs_alloc.c


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Aug 2004 12:41:04 -0700 (PDT)

dillon      2004/08/09 12:41:04 PDT

DragonFly src repository

  Modified files:
    sys/vfs/ufs          ffs_alloc.c 
  Log:
  ffs_dirpref() calculates dirsize = (fs->fs_avgfilesize * fs->fs_avgfpdir).
  However, these two paramters can be set by the sysop such that they easily
  overflow a 32 bit integer.  Use 64 bit arithmatic to prevent the overflow
  and special-case values > 0x7fffffff to simply set maxcontigdirs to 1 rather
  then waste time doing further 64 bit arithmatic.
  
  Note that NetBSD also changed 'cgsize' to a 64 bit integer, but fails to
  properly cast at least one of the arguments in both the dirsize and cgsize
  multiplication which means that the overflow bug in NetBSD has not actually
  been fixed.
  
  This patch does not change the cgsize calculation yet, it requires more
  review.
  
  Source: NetBSD ffs_alloc.c/1.74 from Barry Bouwsma of Tiengen.
  
  Revision  Changes    Path
  1.11      +21 -9     src/sys/vfs/ufs/ffs_alloc.c


http://www.dragonflybsd.org/cvsweb/src/sys/vfs/ufs/ffs_alloc.c.diff?r1=1.10&r2=1.11&f=u



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]