mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
rbd: disable FeatureDeepFlatten when doing DeepCopy()
Not all Linux kernels support the deep-flatten feature. Disabling the feature makes it possible to map RBD images on older kernels (like what minikube uses). Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
4908ff8743
commit
b1045364d9
@ -1531,7 +1531,24 @@ func (rv *rbdVolume) DeepCopy(dest *rbdVolume) error {
|
|||||||
}
|
}
|
||||||
defer image.Close()
|
defer image.Close()
|
||||||
|
|
||||||
return image.DeepCopy(dest.ioctx, dest.RbdImageName, opts)
|
err = image.DeepCopy(dest.ioctx, dest.RbdImageName, opts)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// deep-flatten is not supported by all clients, so disable it
|
||||||
|
return dest.DisableDeepFlatten()
|
||||||
|
}
|
||||||
|
|
||||||
|
// DisableDeepFlatten removed the deep-flatten feature from the image.
|
||||||
|
func (rv *rbdVolume) DisableDeepFlatten() error {
|
||||||
|
image, err := rv.open()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer image.Close()
|
||||||
|
|
||||||
|
return image.UpdateFeatures(librbd.FeatureDeepFlatten, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rv *rbdVolume) listSnapshots() ([]librbd.SnapInfo, error) {
|
func (rv *rbdVolume) listSnapshots() ([]librbd.SnapInfo, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user