Dear Gents, We are using libsmbclient smbc_getFunctionRead to read from a Microsoft DFS share. Before each 64k read there are a QUERY_PATH_INFO and a GET_DFS_REFERRAL which slow down the transmission. Is there a way to query these only once at the beginning of the transmission and cache it? system: 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux lib: libsmbclient:amd64 2:4.1.17+dfsg-2 amd64 shared library for communication with SMB/CIFS servers libsmbclient-dev:amd64 2:4.1.17+dfsg-2 amd64 development files for libsmbclient smbclient 2:4.1.17+dfsg-2 amd64 command-line SMB/CIFS clients for Unix Thank you all your help in advance. Kind regards, Szilard
On Wed, May 27, 2015 at 11:16:08PM +0200, Szilard Matyas wrote:> Dear Gents, > > We are using libsmbclient smbc_getFunctionRead to read from a Microsoft DFS > share. Before each 64k read there are a QUERY_PATH_INFO and a > GET_DFS_REFERRAL which slow down the transmission. Is there a way to query > these only once at the beginning of the transmission and cache it?Hmmm. This seems to be done inside : SMBC_read_ctx(SMBCCTX *context, SMBCFILE *file, void *buf, size_t count) where it's doing: status = cli_resolve_path(frame, "", context->internal->auth_info, file->srv->cli, path, &targetcli, &targetpath); before each call to cli_read(), which does seem rather excessive. I'm guessing it's to allow a DFS server to go down mid-read, and allow a replica to take over.... Let me think about this some more. You might want to log this as a bug to make it easier to track. Thanks, Jeremy.
Hi Jeremy, It's now clear. We'll do a short term workaround somehow. I created the bug. https://bugzilla.samba.org/show_bug.cgi?id=11295 Thanks for the useful reply. Kind regards, Szilard 2015-05-28 2:27 GMT+02:00 Jeremy Allison <jra at samba.org>:> On Wed, May 27, 2015 at 11:16:08PM +0200, Szilard Matyas wrote: > > Dear Gents, > > > > We are using libsmbclient smbc_getFunctionRead to read from a Microsoft > DFS > > share. Before each 64k read there are a QUERY_PATH_INFO and a > > GET_DFS_REFERRAL which slow down the transmission. Is there a way to > query > > these only once at the beginning of the transmission and cache it? > > Hmmm. This seems to be done inside : > > SMBC_read_ctx(SMBCCTX *context, > SMBCFILE *file, > void *buf, > size_t count) > > where it's doing: > > status = cli_resolve_path(frame, "", context->internal->auth_info, > file->srv->cli, path, > &targetcli, &targetpath); > > before each call to cli_read(), which does seem rather > excessive. > > I'm guessing it's to allow a DFS server to go down mid-read, > and allow a replica to take over.... Let me think about this > some more. > > You might want to log this as a bug to make it easier to > track. > > Thanks, > > Jeremy. >