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 
  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
  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


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