aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2018-07-12 01:16:49 -0700
committerGitHub <noreply@github.com>2018-07-12 01:16:49 -0700
commitcf5739946bd790677de1ee03d9da438493476189 (patch)
treececbcb4d8340f63dd6a1f280e1cb29bb79730d72
parent2fd48df9d9b8dba87ffd3c811a315dccdd321017 (diff)
parent1ed41f8b21b4cd46aa05f1088283b8ba8b3b4434 (diff)
downloadseaweedfs-cf5739946bd790677de1ee03d9da438493476189.tar.xz
seaweedfs-cf5739946bd790677de1ee03d9da438493476189.zip
Merge pull request #687 from qszxnp/filer2_dir_create_bugfix
bugfix:check Directory attr before create it
-rw-r--r--weed/filer2/filer.go2
1 files changed, 2 insertions, 0 deletions
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