mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 04:10:22 +00:00
cephfs: make use of subvolumeInfo.state to determine quota
https://github.com/ceph/go-ceph/pull/455/ added `state` field to subvolume info struct which helps to identify the snapshot retention state in the caller. This patch make use of the same Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
66fa5891b2
commit
edf511a833
@ -109,9 +109,7 @@ func (vo *volumeOptions) getSubVolumeInfo(ctx context.Context, volID volumeID) (
|
||||
// If info.BytesQuota == Infinite (in case it is not set)
|
||||
// or nil (in case the subvolume is in snapshot-retained state),
|
||||
// just continue without returning quota information.
|
||||
// TODO: make use of subvolume "state" attribute once
|
||||
// https://github.com/ceph/go-ceph/issues/453 is fixed.
|
||||
if !(info.BytesQuota == fsAdmin.Infinite || info.BytesQuota == nil) {
|
||||
if !(info.BytesQuota == fsAdmin.Infinite || info.State == fsAdmin.StateSnapRetained) {
|
||||
return nil, fmt.Errorf("subvolume %s has unsupported quota: %v", string(volID), info.BytesQuota)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user