I would like to be able to see used/available space in the properties of a SMB share folder - just like in my home folder. I can see that "ls" in smbclient returns this information so it should be readily available from the share. Example: "38093 blocks of size 8388608. 32358 blocks available" Reproducible: Always
This should be implemented for a while already, looking at some sample servers I am not sure that is actually working correctly though. Possibly related https://bugzilla.samba.org/show_bug.cgi?id=11810 With a windows10 or ubuntu18.04 server the actual block is f_frsize*f_bsize by the looks of it, which is I think not how statvfs should behave anywhere. Anyway, needs investigation.
Quick update: seems statvfs outright makes up its own meaning https://github.com/samba-team/samba/blob/8b04590e4d8f817ad6d194bb9d622c18734e3011/source3/libsmb/libsmb_stat.c#L420 without unix extension the actual blocksize is f_frsize*f_bsize, with unix extension f_frsize is not getting set at all, I guess we need to handle these separately on our end as well `if(f_frsize==0)`
Git commit 6832817f311bfa106ee971ae51bac288843af08b by Harald Sitter. Committed on 13/02/2020 at 11:17. Pushed by sitter into branch 'master'. smb: fix free space calculation Summary: - collapse statvfs call, there's no purpose in manually opening the file when libsmbc has a convenience wrapper that does exactly what we need with less code on our end - blockSize is now calculated as per the conditional branches in smbc_stat.c - free space calculation is now backwards compatible with slightly busted legacy versions of libsmbc not setting f_bavail FIXED-IN: 19.12.3 Test Plan: free space calculation now works with windows10, ubuntu18.04, ubuntu19.10 Reviewers: ngraham, meven Reviewed By: ngraham, meven Subscribers: meven, kde-frameworks-devel, kfm-devel Tags: #dolphin, #frameworks Differential Revision: https://phabricator.kde.org/D27294 M +20 -17 smb/kio_smb_browse.cpp https://commits.kde.org/kio-extras/6832817f311bfa106ee971ae51bac288843af08b