mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: round to cephfs size to multiple of 4Mib
Due to the bug in the df stat we need to round off the subvolume size to align with 4Mib. Note:- Minimum supported size in cephcsi is 1Mib, we dont need to take care of Kib. fixes #3240 More details at https://github.com/ceph/ceph/pull/46905 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
1856647506
commit
f171143135
@ -277,7 +277,7 @@ func (cs *ControllerServer) CreateVolume(
|
||||
defer volOptions.Destroy()
|
||||
|
||||
if req.GetCapacityRange() != nil {
|
||||
volOptions.Size = util.RoundOffBytes(req.GetCapacityRange().GetRequiredBytes())
|
||||
volOptions.Size = util.RoundOffCephFSVolSize(req.GetCapacityRange().GetRequiredBytes())
|
||||
}
|
||||
|
||||
parentVol, pvID, sID, err := checkContentSource(ctx, req, cr)
|
||||
@ -672,7 +672,8 @@ func (cs *ControllerServer) ControllerExpandVolume(
|
||||
return nil, status.Error(codes.InvalidArgument, "cannot expand snapshot-backed volume")
|
||||
}
|
||||
|
||||
RoundOffSize := util.RoundOffBytes(req.GetCapacityRange().GetRequiredBytes())
|
||||
RoundOffSize := util.RoundOffCephFSVolSize(req.GetCapacityRange().GetRequiredBytes())
|
||||
|
||||
volClient := core.NewSubVolume(volOptions.GetConnection(), &volOptions.SubVolume, volOptions.ClusterID)
|
||||
if err = volClient.ResizeVolume(ctx, RoundOffSize); err != nil {
|
||||
log.ErrorLog(ctx, "failed to expand volume %s: %v", fsutil.VolumeID(volIdentifier.FsSubvolName), err)
|
||||
|
Reference in New Issue
Block a user