davids5 commented on pull request #3785:
URL: https://github.com/apache/incubator-nuttx/pull/3785#issuecomment-849024691


   I compared the `nfreeclusters == 131702 `  in `fat_computefreeclusters` with 
fsck.msdos 
   
   ```
   sudo fsck.msdos -v -f -n /dev/sdb1
   fsck.fat 4.1 (2017-01-24)
   Checking we can access the last sector of the filesystem
   Boot sector contents:
   System ID "        "
   Media byte 0xf8 (hard disk)
          512 bytes per logical sector
        32768 bytes per cluster
         4404 reserved sectors
   First FAT starts at byte 2254848 (sector 4404)
            2 FATs, 32 bit entries
       969728 bytes per FAT (= 1894 sectors)
   Root directory start at cluster 2 (arbitrary size)
   Data area starts at byte 4194304 (sector 8192)
       242304 data clusters (7939817472 bytes)
   63 sectors/track, 255 heads
         8192 hidden sectors
     15515648 sectors total
   Start cluster field in VFAT long filename slot is not 0 (but 0x000a).
   Auto-setting to 0.
   Start cluster field in VFAT long filename slot is not 0 (but 0x001d).
   Auto-setting to 0.
   Start cluster field in VFAT long filename slot is not 0 (but 0x363e).
   Auto-setting to 0.
   Reclaiming unconnected clusters.
   Checking free cluster summary.
   Free cluster summary wrong (131702 vs. really 131704)
     Auto-correcting.
   Leaving filesystem unchanged.
   /dev/sdb1: 65 files, 110600/242304 clusters
   ``` 
   
   And the calculation makes more sense with this PR, but I am puzzled by  
   
   `Free cluster summary wrong (131702 vs. really 131704)`
   
   We should merge this because without this commit the numbers are completely 
bogus (`nfreeclusters == 131458`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to