Tighten disk safety checks
This commit is contained in:
1 parent
b8eabee393
commit
75c6b928ae
5 files changed
+92
-8
No files matched your search
@@ -65,6 +65,10 @@ func (s *Server) handleDiskInit(w http.ResponseWriter, r *http.Request) {
|
||||
jsonErr(w, http.StatusConflict, "disk already initialized")
|
||||
return
|
||||
}
|
||||
if err := disk.CheckWritable(info.MountPath); err != nil {
|
||||
jsonErr(w, http.StatusUnprocessableEntity, "disk is not writable: "+err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
diskID, err := disk.InitDisk(info.MountPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user