Win 8.1 show roundup size in 'Size on disk' column

Jones jones.kstw at gmail.com
Sat Feb 8 04:51:45 MST 2014


Hello list,

The client is windows 8.1,
and the server is samba-4.1.4,
there is a 30-byte txt file resident in server,

Through file explorer and right click this file -> Properties,
under General tag there are 2 column to show file size,
it is like the 'Size on disk' is rounding up.
(1) Size: 30 bytes (30 bytes)
(2) Size on disk: 1.00 MB (1,408,576 bytes)

And 'Size on disk' depends on 'allocation roundup size',
if 'allocation roundup size' = 1408576 (default),
the 'Size on disk' is 1.00 MB;
if 'allocation roundup size' = 268435456,
the 'Size on disk' is 256.00 MB;

With wireshark,
found the 'Size' is the same as 'End Of File',
and 'Size on disk' is the same as 'Allocation Size'.

Windows 7, Windows Server 2008R2 does not show oversize value in 'Size on
disk'.

After manually editing this and re-build,
it is okay to show probably size in 'Size on disk' with windows 8.1,
samba-4.1.4/source3/modules/vfs_default.c
...
        if (fsp && fsp->initial_allocation_size)
                result = MAX(result,fsp->initial_allocation_size);

-       result = smb_roundup(handle->conn, result);
+      result = SMB_ROUNDUP(result, 4096);

 out:
        END_PROFILE(syscall_get_alloc_size);
        return result;
...


Question:
It is likely latest windows 8.1 got this unexpected value in 'Size on disk',
and 'allocation roundup size = 268435456' is my default setting to improve
performance,
but im not sure how to fix this issue for windows 8.1,
any suggestion is deeply appreciated,
thanks.

References:
(1)
http://social.technet.microsoft.com/Forums/windows/en-US/8bd3dab7-eb71-4ffb-90de-32d7f756cf69/windows-8-displays-wrong-disk-size-on-nas-drive?forum=w8itprogeneral
(2) https://wiki.samba.org/index.php/Linux_Performance

-- 
Jones


More information about the samba-technical mailing list