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:
Humble Chirammal 2021-08-17 16:32:46 +05:30 committed by mergify[bot]
parent 66fa5891b2
commit edf511a833

View File

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