mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(client): set usedSize as totalSize if usedSize > totalSize when queried from master, to avoid displaying anomalies such as cmd df
Signed-off-by: true1064 <tangjingyu@oppo.com>
(cherry picked from commit 0c6bb1d0b5)
This commit is contained in:
parent
f1bf550713
commit
84795afb21
@ -163,6 +163,13 @@ func (mw *MetaWrapper) updateVolStatInfo() (err error) {
|
||||
log.LogWarnf("updateVolStatInfo: get volume status fail: volume(%v) err(%v)", mw.volname, err)
|
||||
return
|
||||
}
|
||||
|
||||
if info.UsedSize > info.TotalSize {
|
||||
log.LogInfof("volume(%v) queried usedSize(%v) is larger than totalSize(%v), force set usedSize as totalSize",
|
||||
mw.volname, info.UsedSize, info.TotalSize)
|
||||
info.UsedSize = info.TotalSize
|
||||
}
|
||||
|
||||
atomic.StoreUint64(&mw.totalSize, info.TotalSize)
|
||||
atomic.StoreUint64(&mw.usedSize, info.UsedSize)
|
||||
atomic.StoreUint64(&mw.inodeCount, info.InodeCount)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user