From edf511a833faf4b3fcebd58db41d84a6754007c1 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 17 Aug 2021 16:32:46 +0530 Subject: [PATCH] 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 --- internal/cephfs/volume.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/cephfs/volume.go b/internal/cephfs/volume.go index 7d11f59ba..9f3c84a67 100644 --- a/internal/cephfs/volume.go +++ b/internal/cephfs/volume.go @@ -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 {