Dolphin doesn't show free space on samba shares

Bug #299946 reported by karaluh
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
KDE Base
Fix Released
Medium
kdebase (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: dolphin

dolphin displays free space on the right side of the status bar. On samba shares the bar is empty with Unknown size label.

affects: dolphin (Ubuntu) → kdebase (Ubuntu)
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

Hi there!

Thanks for reporting this bug! Your bug seems to be a problem with the KDE program itself, and not with our KDE packages. While we appreciate your issue, it would be better if it was tracked at https://bugs.kde.org, so that the KDE developers can deal with this speedily and have direct communication with you as the reporter for more effective debugging.

Thanks!

Changed in kdebase (Ubuntu):
status: New → Invalid
Changed in kdebase:
status: Unknown → New
Revision history for this message
In , karaluh (karaluh) wrote :

Version: unspecified
OS: Linux

dolphin displays free space on the right side of the status bar. On samba shares the bar is empty with Unknown size label.

Reproducible: Didn't try

OS: Linux (i686) release 2.6.32-0206321505-generic
Compiler: cc

Revision history for this message
In , FiNeX (finex) wrote :

@Peter: Is this information available trough the SMB protocol?

Changed in kdebase:
status: New → Confirmed
Revision history for this message
In , Peter-penz19 (peter-penz19) wrote :

> @Peter: Is this information available trough the SMB protocol?

@FiNeX: I don't know :-( Dolphin uses KDiskFreeSpaceInfo for getting this information. I had a short look at the code, but I'm not sure. I guess David or Sebastian might be able to answer this question off the bat.

Revision history for this message
In , David Faure (faure) wrote :

I don't know enough about the SMB protocol to answer this.
If SMB provides this info, then we also have to make it available as a kioslave special() command, but that's the 2nd step (which I can do). First step: how could kio_smb find out the available space on a share? Reassigning to kio_smb.

Revision history for this message
In , FiNeX (finex) wrote :

After some googling I've found the following links:

  http://www.protocols.com/pbook/ibm.htm#SMB
  http://www.protocolbase.net/protocols/protocol_SMB.php

They talk about "[get server info] Get total and free space for server disk."

Could this info be useful in some way?

Revision history for this message
In , Z-sander (z-sander) wrote :

smbclient shows the free space on remote shares (I just checked in interactive mode)

It outputs it in a bit strange way, but it's correct:

"34175 blocks of size 8388608. 2269 blocks available"

8388608 = 8192 * 1024, so each block is 8MB

I have absolutely no idea why it uses 8MB blocks, but that's not the point :)

Changed in kdebase:
importance: Unknown → Medium
Revision history for this message
In , Mathias Tillman (master-homer) wrote :

Sorry to comment on such an old bug, but this is still not implemented in KDE 4.12. I know this can be done as I've done it myself using libsmbclient. Here is an example implementation that works just fine:
void auth_fn(const char *server, const char *share,
         char *workgroup, int wgmaxlen, char *username, int unmaxlen,
         char *password, int pwmaxlen)
{
    strcpy(username, "guest");
}

bool calculateSMBSpace(char *url, unsigned long long &spaceTotal, unsigned long long &spaceFree) {
    int err = smbc_init(auth_fn, 0);
    if (err < 0) {
        return false;
    }

    int handle = smbc_opendir(url);
    if(handle < 0) {
        return false;
    }

    struct statvfs dirStat;
    err = smbc_fstatvfs(handle, &dirStat);
    smbc_closedir(handle);

    if (err < 0) {
        return false;
    }

    spaceTotal = dirStat.f_bsize * dirStat.f_blocks;
    spaceFree = dirStat.f_bsize * dirStat.f_bavail;

    return true;
}

I would write the implementation myself, but I don't know my way around the KDE code too well and I'm not sure if libsmbclient is cross-platform which might mean that some OSes would be left out.

Changed in kde-baseapps:
status: Confirmed → Unknown
Revision history for this message
In , Mauro (mauromol) wrote :

I really miss this information.

Revision history for this message
In , Mathias Tillman (master-homer) wrote :

Git commit 7651cdccb204d6a4ae7157695bf4c925701a18c5 by Mathias Tillman.
Committed on 14/09/2014 at 16:53.
Pushed by mathiastillman into branch 'frameworks'.

Make the statusbar space info use the new KIO::fileSystemFreeSpace job.

REVIEW: 120137

M +18 -11 dolphin/src/statusbar/mountpointobserver.cpp
M +13 -15 dolphin/src/statusbar/mountpointobserver.h
M +23 -18 dolphin/src/statusbar/mountpointobservercache.cpp
M +4 -4 dolphin/src/statusbar/mountpointobservercache.h
M +31 -35 dolphin/src/statusbar/spaceinfoobserver.cpp
M +9 -1 dolphin/src/statusbar/spaceinfoobserver.h
M +1 -1 dolphin/src/statusbar/statusbarspaceinfo.cpp

http://commits.kde.org/kde-baseapps/7651cdccb204d6a4ae7157695bf4c925701a18c5

Changed in kde-baseapps:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.