Tighten disk safety checks

This commit is contained in:
2026-04-24 07:18:17 +03:00
parent b8eabee393
commit 75c6b928ae
5 changed files with 92 additions and 8 deletions

View File

@@ -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 {