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

cmd/fsck: add repair option to repair broken directories #2654

Merged
merged 3 commits into from
Sep 6, 2022
Merged

Conversation

SandyXSD
Copy link
Contributor

No description provided.

cmd/fsck.go Outdated Show resolved Hide resolved
pkg/meta/redis.go Outdated Show resolved Hide resolved
@SandyXSD SandyXSD marked this pull request as ready for review September 6, 2022 08:52
@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@SandyXSD SandyXSD requested a review from davies September 6, 2022 10:00
$ juicefs fsck redis://localhost`,
$ juicefs fsck redis://localhost

# Repair broken directories
Copy link
Contributor

Choose a reason for hiding this comment

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

it could be a file

// missing attribute
p := "/" + path.Join(ps[:i+1]...)
if attr.Typ != TypeDirectory { // TODO: determine file size?
logger.Errorf("Path %s (inode %d type %d) cannot be auto-repaired, you have to repair it manually or remove it", p, inode, attr.Typ)
Copy link
Contributor

Choose a reason for hiding this comment

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

calculate the size based on chunks

Copy link
Contributor

@davies davies left a comment

Choose a reason for hiding this comment

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

LGTM for directories. we can fix files with another PR.

@SandyXSD
Copy link
Contributor Author

SandyXSD commented Sep 6, 2022

LGTM for directories. we can fix files with another PR.

Sure.

@SandyXSD SandyXSD merged commit 92eea36 into main Sep 6, 2022
@SandyXSD SandyXSD deleted the fsck-repair branch September 6, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants