Bug 11295 - Excessive cli_resolve_path() usage can slow down transmission
Excessive cli_resolve_path() usage can slow down transmission
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient
x64 Linux
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2015-05-28 09:12 UTC by Szilard Matyas
Modified: 2015-06-17 18:05 UTC (History)
1 user (show)

See Also:

git-am fix for master. (10.82 KB, patch)
2015-05-28 18:10 UTC, Jeremy Allison
no flags Details
git-am fix cherry-picked from master for 4.2.next, 4.1.next. (10.94 KB, patch)
2015-06-05 17:32 UTC, Jeremy Allison
obnox: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Szilard Matyas 2015-05-28 09:12:58 UTC
cli_resolve_path() is invoked in every SMBC_read_ctx() and SMBC_write_ctx() that slows down transmission dramatically if DFS client and root are located on geographically distant locations(high RTT between them).
Comment 1 Jeremy Allison 2015-05-28 17:20:42 UTC
(from the samba-tecnhical mailing list).

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
Comment 2 Jeremy Allison 2015-05-28 18:10:38 UTC
Created attachment 11101 [details]
git-am fix for master.

Can you test this patch ? I think it both fixes your issue and fixes a correctness problem with the code.


Comment 3 Szilard Matyas 2015-06-04 11:22:28 UTC
The patch resolves the issue. Thx for the effort.

Comment 4 Jeremy Allison 2015-06-04 16:38:35 UTC
I appreciate the confidence, but the work to get it into the code now starts :-).

It needs a second Team reviewer to get into master, and then this bug report needs to remain open to hold the patches for 4.2.x (and 4.1.x if we back-port) until the change is committed to the git repo.

Thanks !

Comment 5 Jeremy Allison 2015-06-05 17:32:52 UTC
Created attachment 11124 [details]
git-am fix cherry-picked from master for 4.2.next, 4.1.next.
Comment 6 Ross Lagerwall 2015-06-07 15:26:53 UTC
Does this need to be done for SMBC_splice_ctx as well?
Comment 7 Michael Adam 2015-06-08 11:18:01 UTC
Karolin, please pick for 4.2.next and 4.1.next.
THanks - Michael
Comment 8 Jeremy Allison 2015-06-08 16:52:52 UTC
(In reply to Ross Lagerwall from comment #6)

Yes - good catch ! But SMBC_splice_ctx doesn't exist in 4.2.x, so that will be a master only fix and doesn't affect Karolin pushing the 4.2.x/4.1.x patches and closing out this bug.

I'll post a new patch for master-only on samba-technical.
Comment 9 Karolin Seeger 2015-06-09 19:43:47 UTC
(In reply to Michael Adam from comment #7)
Pushed to autobuild-v4-[1|2]-test.
Comment 10 Karolin Seeger 2015-06-17 18:05:10 UTC
(In reply to Karolin Seeger from comment #9)
Pushed to both branches.
CLosing out bug report.