1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed free reports negative used amount

Discussion in 'Support' started by TimButterfield, Feb 16, 2012.

  1. TimButterfield

    Joined:
    May 20, 2008
    Messages:
    399
    Likes Received:
    1
    My J: drive is an network file store. I ran out of quota space copying to it from my 2008 R2 64-bit VM and, after removing the partial copy, checked the drive space. Here is what was reported.

    D:\free j:

    Volume in drive J is Transfer Serial number is ...
    2,147,483,648 bytes total disk space
    -70,969,159,680 bytes used
    73,116,643,328 bytes free
    -3304.8 % in use

    D:\>ver /r
    TCC LE 13.03.39 x64 Windows 2008 [Version 6.0.6001]
    TCC LE Build 39 Windows 2008 Build 6001 Service Pack 1

    That was checked from the VM. Just in case the error was version specific, I also checked from my Win7 laptop.

    D:\>free j:

    Volume in drive J is Transfer Serial number is ...
    2,147,483,648 bytes total disk space
    -70,969,163,776 bytes used
    73,116,647,424 bytes free
    -3304.8 % in use

    D:\>ver /r

    TCC 13.03.39 Windows 7 [Version 6.1.7600]
    TCC Build 39 Windows 7 Build 7600

    Volume data as reported by Windows Explorer properties:
    Type: Network Drive
    File system: NTFS
    Used: 19.6GB (21,091,037,184 bytes)
    Free: 19.4GB (20,851,998,720 bytes)
    Capacity: 39.0GB (41,943,035,904 bytes)
    The free command appears to be using max_long + 1 for this drive size.
     
  2. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    560
    Likes Received:
    8
    Glad to see that I'm not the only one.
    Code:
    [C:\temp]
    14:49:26 $ free s:
     
    Volume in drive S is Storage        Serial number is 3887:3b0f
      375,809,638,400 bytes total disk space
    -1,554,979,155,968 bytes used
    1,930,788,794,368 bytes free
                -413.8 % in use
    
    DIR has the same issues of wrong results.

    Here's DIR from CMD (trimmed to show header and footer only.
    Code:
    C:\temp>dir s:
    Volume in drive S is Storage
    Volume Serial Number is 3887-3B0F
     
    Directory of S:\
     
    8< ---------------- snip ------------------- >8
     
                  0 File(s)              0 bytes
                  67 Dir(s)  59,992,186,880 bytes free
    
    and here's DIR from TCC.
    Code:
    [C:\temp]
    14:57:25 $ *dir /u s:
     
    Volume in drive S is Storage        Serial number is 3887:3b0f
    Directory of  S:\*
     
                    0 bytes in 0 files and 67 dirs
    1,930,684,080,128 bytes free
    
    The results from the CMD version of DIR match the results of right-clicking on the drive and viewing properties in Windows.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    TCC uses 64-bit ints for all of the sizes.

    This isn't reproducible here. But it has to be a Windows (or device driver) bug, as TCC is simply querying the Windows API and returning the result. I'll see if there is anything I can do to check for obviously wrong results and try to autocorrect them.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    I still can't reproduce this here (tried it on 5 systems and 3 different networks). I did trace the code, and the only way this can happen is if you have a bug in your redirector -- all TCC is doing is calling the Windows GetDiskFreeSpaceEx API.

    I added some code in 13.03.42 to suppress the output if it's obviously wrong. (There's not much I can do to get the "right" output if Windows won't return it.)
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    I've uploaded a test build to ftp.jpsoft.com/beta/tcmd.exe (or ftp.jpsoft.com/beta/tcmdx64.exe). Try downloading that and see if the FREE behavior is better.
     
  6. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    560
    Likes Received:
    8
    That looks to have corrected the problem with both DIR and FREE. Here are a couple FREEs that reference the same storage location but with different sizes allocated to the shares. From looking at the numbers, it appears there was some mixed information that was polluting the results.

    Code:
    [C:\temp]
    09:47:13 $ free q:
     
     Volume in drive Q is Storage        Serial number is 3887:3b0f
        42,949,672,960 bytes total disk space
         3,299,635,200 bytes used
        39,650,037,760 bytes free
                   7.7 % in use
     
    [C:\temp]
    09:47:23 $ free s:
     
     Volume in drive S is Storage        Serial number is 3887:3b0f
       375,809,638,400 bytes total disk space
       317,089,845,248 bytes used
        58,719,793,152 bytes free
                  84.4 % in use
     
    [C:\temp]
    09:47:25 $ free u:
     
     Volume in drive U is Storage        Serial number is 3887:3b0f
     3,599,934,763,008 bytes total disk space
     1,668,437,012,480 bytes used
     1,931,497,750,528 bytes free
                  46.3 % in use
    
     
  7. TimButterfield

    Joined:
    May 20, 2008
    Messages:
    399
    Likes Received:
    1
    Thanks for testing the change, John. I was away for a long weekend with only Edge cell network data access and FTP access is blocked at the office where I am today.

    Rex, If you want, I can download from FTP tonight and test it tomorrow.
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    Try it with the released 13.03.45 and let me know if it works for you.
     
  9. TimButterfield

    Joined:
    May 20, 2008
    Messages:
    399
    Likes Received:
    1
    The displayed values appear to be correct with free and dir on Win7 and 2008x64.
     

Share This Page