From 1ed41f8b21b4cd46aa05f1088283b8ba8b3b4434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=82=E9=B9=8F?= Date: Thu, 12 Jul 2018 00:53:31 -0400 Subject: [PATCH] bugfix:check Directory attr before create it --- weed/filer2/filer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index 53de5bea3..9c4dd8324 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -80,6 +80,8 @@ func (f *Filer) CreateEntry(entry *Entry) error { if mkdirErr != nil { return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr) } + } else if !dirEntry.IsDirectory() { + return fmt.Errorf("%s is a file", dirPath) } // cache the directory entry