gvfs and (lib)smbclient (resend)

Ross Lagerwall rosslagerwall at gmail.com
Sat Aug 2 09:01:18 MDT 2014


Hi all,

(I sent this to the samba list a few months back with little response so
resending to samba-technical in the hope of more feedback.)

I'm one of the GNOME gvfs maintainers, and would like to improve the support of
smb in gvfs, especially in the context of taking advantage of the improvements
of SMB2 and SMB3.  Currently we use libsmbclient which provides a fairly easy to
use API.  It is not, however, quite sufficient for the way that we would like to
use it (at least I think so):

- Slow transfer speeds.  Although passing very large blocks to
libsmbclient does cause it to pipeline requests, this is not always
practical, and it's not really possible to get the level of pipelining
seen with smbclient where you can have multiple 1MB requests in flight.
Some sort of async interface would be nice.  We also usually want to
display progress with a reasonable resolution....

- The mapping between NT error message and UNIX errno makes it difficult to
provide a nice error message to the user or even to know what's going on.  For
example, calling rename() with one of the path's having an invalid character
gives ENOMEM.  It is difficult to tell whether this is an out of memory error,
a malformed source URI or a malformed target URI.  It would be nice to get
access to the real error message.
Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=702568
              https://bugzilla.gnome.org/show_bug.cgi?id=350976

- No way of easily mapping to and from POSIX permissions resulting in files'
permissions often being inadvertently changed when saving files.
Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=592651
              https://bugzilla.gnome.org/show_bug.cgi?id=581368

- No support for POSIX extensions.
Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=562029
              https://bugzilla.samba.org/show_bug.cgi?id=5926

- No support for file monitoring, e.g. NT_TRANSACT_NOTIFY_CHANGE.
Related bugs: https://bugzilla.gnome.org/show_bug.cgi?id=627107
              https://bugzilla.samba.org/show_bug.cgi?id=7393

- Some extras that would be nice to have:
Server side copy.  (I understand this hasn't been implemented in Samba
client-side?).
Setting mtime and atime individually.
Finer-grained (e.g. microsecond/nanosecond) timestamps.


While some of these problems could probably be fixed by extending
libsmbclient, I feel that libsmbclient is probably slightly too
high-level for ideal use in gvfs.  I note the existence of
libsmbclient-raw but it appears to not provide a stable (or documented!)
API.  Searching through the mailing lists shows that I'm not the only
one to come to this conclusion, but I suppose the difficulty is in
getting the level of abstraction in the library correct.

Cheers
-- 
Ross Lagerwall


More information about the samba-technical mailing list