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/debug: assuming the mount point is juicefs mount point #5435

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,20 @@ func collectSpecialFile(ctx *cli.Context, amp string, currDir string, requireRoo
func debug(ctx *cli.Context) error {
setup(ctx, 1)
mp := ctx.Args().First()
inode, err := utils.GetFileInode(mp)
if err != nil {
return fmt.Errorf("failed to lookup inode for %s: %s", mp, err)
}
if inode != uint64(meta.RootInode) {
return fmt.Errorf("path %s is not a mount point", mp)
var inode uint64
if err := utils.WithTimeout(func() error {
var err error
if inode, err = utils.GetFileInode(mp); err != nil {
return fmt.Errorf("failed to lookup inode for %s: %s", mp, err)
}
return nil
}, 3*time.Second); err != nil {
logger.Warnf(err.Error())
logger.Warnf("assuming the mount point is JuiceFS mount point")
} else {
if inode != uint64(meta.RootInode) {
return fmt.Errorf("path %s is not a mount point", mp)
}
}

amp, err := filepath.Abs(mp)
Expand Down
Loading