浏览代码

devicemapper: Skip the files with prefix "." during device map construction

Any file which starts with "." is not a valid metadata file. Skip it
during device map construction.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Vivek Goyal 10 年之前
父节点
当前提交
080a6f1e4b
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      daemon/graphdriver/devmapper/deviceset.go

+ 5 - 0
daemon/graphdriver/devmapper/deviceset.go

@@ -323,6 +323,11 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo)
 		return nil
 	}
 
+	if strings.HasPrefix(finfo.Name(), ".") {
+		log.Debugf("Skipping file %s", path)
+		return nil
+	}
+
 	if finfo.Name() == deviceSetMetaFile {
 		log.Debugf("Skipping file %s", path)
 		return nil