Skip to content

Commit 02da046

Browse files
committed
small fixes
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
1 parent 752c692 commit 02da046

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

changelog/unreleased/decomposedfs-xattr-errors.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Enhancement: Refactored the xattrs package in the decomposedfs
33
The xattrs package now uses the xattr.ENOATTR instead of os.ENODATA or os.ENOATTR to check attribute existence.
44

55
https://github.com/cs3org/reva/pull/2540
6+
https://github.com/cs3org/reva/pull/2541

pkg/storage/utils/decomposedfs/node/node.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (n *Node) Child(ctx context.Context, name string) (*Node, error) {
265265

266266
var c *Node
267267
if strings.HasPrefix(link, "../") {
268-
c, err = ReadNode(ctx, n.lu, filepath.Base(link))
268+
c, err = ReadNode(ctx, n.lu, spaceID, filepath.Base(link))
269269
if err != nil {
270270
return nil, errors.Wrap(err, "could not read child node")
271271
}
@@ -411,11 +411,6 @@ func (n *Node) LockFilePath() string {
411411
return n.InternalPath() + ".lock"
412412
}
413413

414-
// LockFilePath returns the internal path of the lock file of the node
415-
func (n *Node) LockFilePath() string {
416-
return n.lu.InternalPath(n.ID) + ".lock"
417-
}
418-
419414
// CalculateEtag returns a hash of fileid + tmtime (or mtime)
420415
func CalculateEtag(nodeID string, tmTime time.Time) (string, error) {
421416
return calculateEtag(nodeID, tmTime)

pkg/storage/utils/decomposedfs/spaces.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,9 @@ func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.De
515515
if len(matches) != 1 {
516516
return fmt.Errorf("delete root node failed: found %d matching root nodes", len(matches))
517517
}
518-
519-
n, err := node.ReadNode(ctx, fs.lu, spaceID, filepath.Base(target))
520-
if err != nil {
521518
return os.RemoveAll(matches[0])
522519
}
520+
523521
// don't delete - just rename
524522
dn := *n
525523
deletionTime := time.Now().UTC().Format(time.RFC3339Nano)
@@ -540,7 +538,7 @@ func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.De
540538
return os.Symlink(trashPath, np)
541539
}
542540

543-
func (fs *Decomposedfs) createStorageSpace(ctx context.Context, spaceType, spaceID string) error {
541+
func (fs *Decomposedfs) createStorageSpace(ctx context.Context, spaceType string, spaceID string) error {
544542
// create space type dir
545543
if err := os.MkdirAll(filepath.Join(fs.o.Root, "spaces", spaceType), 0700); err != nil {
546544
return err

0 commit comments

Comments
 (0)