aboutsummaryrefslogtreecommitdiff
path: root/weed/command/fix.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-07-16 22:50:14 -0700
committerChris Lu <chris.lu@gmail.com>2020-07-16 22:50:14 -0700
commitf43146b237bc5bbfb7033f6e427b5299554c0824 (patch)
treedf4a05999d67abb7c4765d39eddc01318521169b /weed/command/fix.go
parentbefb396892deb7e5fdaefaf2f952bd744cc08ace (diff)
downloadseaweedfs-f43146b237bc5bbfb7033f6e427b5299554c0824.tar.xz
seaweedfs-f43146b237bc5bbfb7033f6e427b5299554c0824.zip
resolve directories if containing home directory
Diffstat (limited to 'weed/command/fix.go')
-rw-r--r--weed/command/fix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/command/fix.go b/weed/command/fix.go
index 223808f4b..e1455790f 100644
--- a/weed/command/fix.go
+++ b/weed/command/fix.go
@@ -11,6 +11,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/storage/needle_map"
"github.com/chrislusf/seaweedfs/weed/storage/super_block"
"github.com/chrislusf/seaweedfs/weed/storage/types"
+ "github.com/chrislusf/seaweedfs/weed/util"
)
func init() {
@@ -67,7 +68,7 @@ func runFix(cmd *Command, args []string) bool {
if *fixVolumeCollection != "" {
baseFileName = *fixVolumeCollection + "_" + baseFileName
}
- indexFileName := path.Join(*fixVolumePath, baseFileName+".idx")
+ indexFileName := path.Join(util.ResolvePath(*fixVolumePath), baseFileName+".idx")
nm := needle_map.NewMemDb()
defer nm.Close()
@@ -77,7 +78,7 @@ func runFix(cmd *Command, args []string) bool {
nm: nm,
}
- if err := storage.ScanVolumeFile(*fixVolumePath, *fixVolumeCollection, vid, storage.NeedleMapInMemory, scanner); err != nil {
+ if err := storage.ScanVolumeFile(util.ResolvePath(*fixVolumePath), *fixVolumeCollection, vid, storage.NeedleMapInMemory, scanner); err != nil {
glog.Fatalf("scan .dat File: %v", err)
os.Remove(indexFileName)
}