From 198ac79c23cf793bd768f8535ca6d1e558dcd1d3 Mon Sep 17 00:00:00 2001 From: zhijian Date: Wed, 25 Dec 2024 18:17:23 +0800 Subject: [PATCH] cmd/debug: assuming the mount point is juicefs mount point Signed-off-by: zhijian --- cmd/debug.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/debug.go b/cmd/debug.go index 45dc3cdfdc6d..90146023a05a 100644 --- a/cmd/debug.go +++ b/cmd/debug.go @@ -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)