cryptfs: fix quota for overwrites if upload fails

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-10-10 19:34:15 +02:00
parent 3e44a1dd2d
commit 0e54fa5655
11 changed files with 145 additions and 45 deletions

View File

@@ -746,6 +746,20 @@ func HasTruncateSupport(fs Fs) bool {
return IsLocalOsFs(fs) || IsSFTPFs(fs) || IsHTTPFs(fs)
}
// HasImplicitAtomicUploads returns true if the fs don't persists partial files on error
func HasImplicitAtomicUploads(fs Fs) bool {
if strings.HasPrefix(fs.Name(), s3fsName) {
return true
}
if strings.HasPrefix(fs.Name(), gcsfsName) {
return true
}
if strings.HasPrefix(fs.Name(), azBlobFsName) {
return true
}
return false
}
// HasOpenRWSupport returns true if the fs can open a file
// for reading and writing at the same time
func HasOpenRWSupport(fs Fs) bool {