Running Samba from Linux can result in this issue on small file sizes. i.e. The directory listing from Mac OS X will show a 1 KB file as 256 KB. Requesting additional information from the finder will display the size as correct, but the 'bytes on disk' will remain incorrect.
Here is a patch, borrowing code from the SMB_FS_SIZE_INFORMATION case. --- trans2.c.orig Thu Oct 2 17:40:45 2003 +++ trans2.c Sat Oct 4 18:04:46 2003 @@ -1407,9 +1407,24 @@ switch (info_level) { case SMB_INFO_ALLOCATION: { - SMB_BIG_UINT dfree,dsize,bsize; + SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector; data_len = 18; SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize); + block_size = lp_block_size(snum); + if (bsize < block_size) { + SMB_BIG_UINT factor = block_size/bsize; + bsize = block_size; + dsize /= factor; + dfree /= factor; + } + if (bsize > block_size) { + SMB_BIG_UINT factor = bsize/block_size; + bsize = block_size; + dsize *= factor; + dfree *= factor; + } + bytes_per_sector = 512; + sectors_per_unit = bsize/bytes_per_sector; SIVAL(pdata,l1_idFileSystem,st.st_dev); SIVAL(pdata,l1_cSectorUnit,bsize/512); SIVAL(pdata,l1_cUnit,dsize);
GREAT JOB!!! This patch just saved my life :) Its working :) Thanx
(Varient) of this patch applied. Thanks, Jeremy.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.