-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Stable9] smbfixes #25817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Stable9] smbfixes #25817
Conversation
|
@butonic, thanks for your PR! By analyzing the annotation information on this pull request, we identified @icewind1991, @jmaciasportela, @PVince81 and @Xenopathic to be potential reviewers |
f001f53 to
a76fa75
Compare
apps/files_external/lib/smb.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a log here. We don't overwrite things often so debugging this could be confusing because we expect no modifications.
0be7a54 to
cdffa9a
Compare
|
This has become a release blocker. |
0eeeb82 to
8b3aad7
Compare
|
hm, I can rename a felder just fine ... also with spaces ... investigating |
|
@DeepDiver1975 is jenkins using phpsmbclient or smbclient via cli? icewind1991/SMB#52 |
smbclient |
|
@DeepDiver1975 for smbclient running the testsuite locally gives me only errors and failures. debugging it I don't seem to be able to Testing with libsmbclient 57of77 tests fail. Running individual tests alone makes them pass ... WTF. Investigating further. |
apps/files_external/lib/smb.php
Outdated
| try { | ||
| $this->log("stat fetching '{$this->root}|$path'"); | ||
| $this->statCache[$path] = $this->share->stat($path); | ||
| if ($this->remoteIsShare() && $this->isRootDir($path) && $this->statCache[$path]->isHidden()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to remove the $this->remoteIsShare() from here. If the remote subfolder isn't empty, the function is intended to return false (we aren't connecting directly to a share but to a inner folder), so in that case if the folder is hidden it won't be shown.
|
FYI: this cannot be automatically tested when you are using any Windows desktop os because "The number of connections is limited to 20 by the software license agreement". Running individual tests works. We are not explicitly closing / disconnecting in tearDown(). That piles up connections and after 20 tests the rest fails ... |
|
great, now all of the tests are broken, but they all work on my machine. |
| if ($this->instance) { | ||
| $this->instance->rmdir(''); | ||
| // force disconnect of the client | ||
| unset($this->instance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe needs a more explicit disconnect ? If it doesn't work on CI it could be due to a different PHP version where maybe the GC works differently ?
Maybe add a method "close" on the SMB instance and use method_exists here before trying to call it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, unsetting works around the connection limit just fine. The problem with nearly all tests failing may have been caused by how the share was set up and which version of smbclient is available.
I have shared my E: drive as 'guest', with a root of '' the testsuite fails completely when using smbclient but completes fine with lbsmbclient. The problem is that I smbclient cannot get a stat with allinfo "/path/to/file". It will always get a NT_STATUS_OBJECT_NAME_NOT_FOUND getting alt name for /path/to/file. There was a related issue regarding the root of a share: #14347
Also, it seems recent smbclient changed the output of allinfo, see icewind1991/SMB#52
remember, all these problems only arise whan using the fallback smbclient implementation.
@DeepDiver1975 we also need to test libsmbclient automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a fallback for failing stats thet try reading the stat info from the parent folders dirlisting. Waiting for jenkins...
|
@butonic are these already on stable9.1 or will they need to be forward-ported too ? |
3893092 to
4a5e32d
Compare
|
need to be forward ported as I was debugging this at a customer. the code in 9.1 and master is exactly the same with the upper/lower case filenames being the exception. |
apps/files_external/lib/smb.php
Outdated
| throw $e; | ||
| } | ||
| } | ||
| if ($this->remoteIsShare() && $this->isRootDir($path) && $this->statCache[$path]->isHidden()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also applies if our root path targets a remote folder, not just the share, so the $this->remoteIsShare() condition should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean when the actual share is eg. \\host\Users but in oc is configured as 'share'=>'\\host\User\Bob', 'root'=>'' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, more or less. An expected configuration should be 'share' => 'Users' , 'root' => 'Bob' so when the user ask for the storage's root path ('') it's internally mapped to \\host\Users\Bob.
In that case, the remoteIsShare() should return false because we're connecting to an inner folder not to the share's root.
|
@jvillafanez I also added the smbclient vs libsmbcliend toggle. @ALL can I haz 👍 pls? |
| private function removeFromCache($path) { | ||
| $path = trim($path, '/'); | ||
| // TODO The CappedCache does not really clear by prefix. It just clears all. | ||
| //$this->dirCache->clear($path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I left them in to hint at what was cached in 8.2. But performance improvements can be done in a separate PR.
|
My only concern is that the Anyway 👍 unless @owncloud/qa says otherwise. |
220a0d3 to
ebf8be1
Compare
|
@butonic had a quick look and it looks fine. @butonic please answer this comment https://github.com/owncloud/core/pull/25817/files#r75436102 Then once Jenkins is ressurected, if the tests pass then 👍 |
|
all tests pass, two thumbs, all comments answered. |
|
will port forward now |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
forward port of some of the smb fixes that went into 8.2
cc @dercorn