Skip to content
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

SharedStorage to new sharing code + cleanup #23919

Merged
merged 8 commits into from
Apr 20, 2016

Conversation

rullzer
Copy link
Contributor

@rullzer rullzer commented Apr 11, 2016

For #22209

This (big) PR will move the sharedstorage over to the share manager. Since this is not a 1 on 1 transformation this will cleanup the shared storage (and simplify it!) as well.

TODO:

  • Get rid of the old share
  • Get rid of functions that are covered in the jail
  • Get rid of all node API usage
  • Squash

CC: @icewind1991

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @icewind1991, @MTGap and @schiesbn to be potential reviewers

@@ -42,7 +42,7 @@ class SharedScanner extends Scanner {
*/
public function getData($path) {
$data = parent::getData($path);
$sourcePath = $this->storage->getSourcePath($path);
$sourcePath = '/' . $this->storage->getOwner($path) . '/' . $this->storage->getSourcePath($path);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be handled cleaner

@rullzer rullzer force-pushed the cyclyc-share-dep-example branch from 9aba49c to 4827c43 Compare April 11, 2016 14:23
@rullzer rullzer mentioned this pull request Apr 13, 2016
@rullzer rullzer force-pushed the cyclyc-share-dep-example branch 2 times, most recently from 60a523f to c57234a Compare April 13, 2016 12:57
@rullzer rullzer mentioned this pull request Apr 13, 2016
19 tasks
@rullzer rullzer force-pushed the cyclyc-share-dep-example branch 4 times, most recently from e45ffa4 to f10bec3 Compare April 15, 2016 07:02
@rullzer
Copy link
Contributor Author

rullzer commented Apr 15, 2016

Ok all seems well. Commits are reorderd and squashed.
Probably best to review per commits (as the uit test fixes are the largest).

@nickvergessen could you see if activities and admin_audit still behave as expected?

Please review: @icewind1991 @PVince81 @MorrisJobke @DeepDiver1975

if ($data === null) {
return null;
}
$sourcePath = '/' . $this->storage->getOwner($path) . '/' . $this->storage->getSourcePath($path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only works for the home storage.

Also it shouldn't be needed, you can get $sourceStorage and $internalPath from the storage without first going trough the absolute path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you are right. let me see if I can fix that a bit cleaner

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fixed $storage->resolvePath is what you want

@rullzer rullzer force-pushed the cyclyc-share-dep-example branch from f10bec3 to b2dfc46 Compare April 15, 2016 10:40
@icewind1991 icewind1991 force-pushed the cyclyc-share-dep-example branch from c6b8d95 to 531f7cb Compare April 15, 2016 12:20
@rullzer rullzer force-pushed the cyclyc-share-dep-example branch from 531f7cb to 8ad4335 Compare April 15, 2016 15:15
@@ -102,4 +102,8 @@ protected function formatCacheEntry($entry) {
public function clear() {
// Not a valid action for Shared Cache
}

public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, $targetPath) {
parent::moveFromCache($sourceCache, $sourcePath, $this->storage->getSourcePath($targetPath));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this missing in the past ? Or is this addition specific to this PR's changes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the past we used the parents function. but now we can't directly because we need to translate the path first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to CacheJail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Because in the cache jail we don't that it is a shared storage. So we don't know that it has getSourcePath

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UHm I mean a jail storage...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or... can we assume that the storage of a cachejail is always a jail?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CacheJail has it's own getSourcePath

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O stupid me. Ok will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok moved.

@nickvergessen
Copy link
Contributor

admin_audit and activity still work

* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $this->getSourcePath($targetInternalPath));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can also be moved to the parent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

@icewind1991
Copy link
Contributor

Code looks good otherwise

@rullzer rullzer force-pushed the cyclyc-share-dep-example branch from 8ad4335 to ff3ffc3 Compare April 18, 2016 19:03
@rullzer rullzer force-pushed the cyclyc-share-dep-example branch from ff3ffc3 to b53d659 Compare April 19, 2016 12:04
@icewind1991
Copy link
Contributor

👍

@MorrisJobke
Copy link
Contributor

I can't judge on the code, but the sharing still works fine (federated shares, link shares, internal shares) So here is my 👍

@DeepDiver1975 DeepDiver1975 merged commit cd01c44 into master Apr 20, 2016
@DeepDiver1975 DeepDiver1975 deleted the cyclyc-share-dep-example branch April 20, 2016 18:37
*/
public function getStorageId() {
if (!$this->storageId) {
$this->storageId = $this->mount->getStorage()->getStorageCache()->getNumericId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this actually done for, the value seems unused? should it be returned?

@PVince81
Copy link
Contributor

Regression: #25186

@PVince81
Copy link
Contributor

PVince81 commented Jul 5, 2016

Partial backport (well, only a very small part) to stable9: #25360

@PVince81
Copy link
Contributor

PVince81 commented Aug 9, 2016

Another nasty regression: #25557

Somehow the introduction of LazyStorageMountInfo completely discarded the workaround we had to prevent recursion with shared mounts from #22945

@DeepDiver1975
Copy link
Member

Another nasty regression: #25557

#25703 as well

@lock
Copy link

lock bot commented Aug 5, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants