Bug 194250

Summary: c_size() function parses terabyte sized files incorrectly due to incorrect scale factor
Product: Base System Reporter: Miles Ohlrich <turingsboy>
Component: binAssignee: Ed Maste <emaste>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Miles Ohlrich 2014-10-08 16:47:00 UTC
In usr.bin/find/function.c in c_size() function, when parsing 
terabyte sized files, it incorrectly thinks 1 TB is 64  GB.

case 'T':                       /* terabytes 1<<40 */

scale = 0x1000000000LL;

...

0x1000000000 bytes = 64GB

The correct code should read:

...

case 'T':                       /* terabytes 1<<40 */

scale = 0x10000000000LL;
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-10-08 17:41:31 UTC
A commit references this bug:

Author: emaste
Date: Wed Oct  8 17:40:59 UTC 2014
New revision: 272762
URL: https://svnweb.freebsd.org/changeset/base/272762

Log:
  Correct scale factor for T terabyte suffix

  PR:		194250
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/find/function.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-10-11 00:31:06 UTC
A commit references this bug:

Author: emaste
Date: Sat Oct 11 00:30:58 UTC 2014
New revision: 272922
URL: https://svnweb.freebsd.org/changeset/base/272922

Log:
  MFC r272762: Correct scale factor for T terabyte suffix

  PR:		194250

Changes:
_U  stable/10/
  stable/10/usr.bin/find/function.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-11 01:01:09 UTC
A commit references this bug:

Author: emaste
Date: Sat Oct 11 01:00:37 UTC 2014
New revision: 272923
URL: https://svnweb.freebsd.org/changeset/base/272923

Log:
  MFC r272762: Correct scale factor for T terabyte suffix

  PR:		194250

Changes:
_U  stable/9/usr.bin/find/
  stable/9/usr.bin/find/function.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-10-11 01:02:11 UTC
A commit references this bug:

Author: emaste
Date: Sat Oct 11 01:01:19 UTC 2014
New revision: 272924
URL: https://svnweb.freebsd.org/changeset/base/272924

Log:
  MFC r272762: Correct scale factor for T terabyte suffix

  PR:		194250

Changes:
_U  stable/8/usr.bin/find/
  stable/8/usr.bin/find/function.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-10-12 00:35:15 UTC
A commit references this bug:

Author: emaste
Date: Sun Oct 12 00:34:19 UTC 2014
New revision: 272975
URL: https://svnweb.freebsd.org/changeset/base/272975

Log:
  MFS r272922: Correct scale factor for T terabyte suffix

  PR:		194250
  Approved by:	re

Changes:
_U  releng/10.1/
  releng/10.1/usr.bin/find/function.c