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

Incorrect repoSize when using symbolic links #4056

Closed
bitspill opened this issue Jul 11, 2017 · 2 comments
Closed

Incorrect repoSize when using symbolic links #4056

bitspill opened this issue Jul 11, 2017 · 2 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/repo Topic repo

Comments

@bitspill
Copy link

bitspill commented Jul 11, 2017

Version information:

go-ipfs version: 0.4.10-
Repo version: 5
System version: amd64/linux
Golang version: go1.8.3

Type:

Bug

Severity:

Low

Description:

If the .ipfs directory is a symbolic link the repoSize as returned by ipfs repo stat or ipfs stats repo will always return 9 bytes regardless of actual data stored

With symlink

~$ ls -al
lrwxrwxrwx   1 ipfs ipfs        9 Jun 22  2016 .ipfs -> ipfs_data
drwxrwxr-x   5 ipfs ipfs     4096 Jul 12 01:25 ipfs_data

~$ ipfs repo stat
NumObjects: 204114
RepoSize:   9
StorageMax: 800000000000
RepoPath:   /home/ipfs/.ipfs
Version:    fs-repo@5

Without symlink

~$ ipfs repo stat
NumObjects: 204114
RepoSize:   49450734482
StorageMax: 800000000000
RepoPath:   /home/ipfs/.ipfs
Version:    fs-repo@5
@bitspill
Copy link
Author

Did some looking and found that filepath.Walk does not follow symbolic links

[1] https://github.com/ipfs/go-ipfs/blob/master/repo/fsrepo/fsrepo.go#L591
[2] https://golang.org/pkg/path/filepath/#Walk

@ghost ghost added kind/bug A bug in existing code (including security flaws) topic/repo Topic repo labels Jul 18, 2017
@whyrusleeping whyrusleeping added the help wanted Seeking public contribution on this issue label Aug 30, 2017
@leerspace
Copy link
Contributor

This was fixed in #4305

@Kubuxu Kubuxu closed this as completed Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/repo Topic repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants