Tighten disk safety checks
This commit is contained in:
@@ -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