fix get file stats for IsEmpty (#4576)

This commit is contained in:
Konstantin Lebedev 2023-06-14 13:43:30 +05:00 committed by GitHub
parent 4dd890d4a2
commit 1e22d5caf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -333,6 +333,6 @@ func (v *Volume) IsReadOnly() bool {
return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow
}
func (v *Volume) IsEmpty() bool {
size, _, _ := v.DataBackend.GetStat()
return size <= 8 && v.ContentSize() == 0
datSize, _, _ := v.FileStat()
return datSize <= super_block.SuperBlockSize && v.ContentSize() == 0
}