From 6af014b7985a0bc71b89454c4bf7bb71968e46bb Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Wed, 12 May 2021 01:31:46 +0000 Subject: [PATCH] ceph: fix hostpath of osd to avoid data corruption A directory is created under dataDirHostPath for each OSD. In host-based cluster, its name is constructed from kernel device name like _dev_sdb though user specifies udev persistent device name. We should use unique name among all OSDs. Closes: https://github.com/rook/rook/issues/7878 Signed-off-by: Satoru Takeuchi --- pkg/operator/ceph/cluster/osd/spec.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/operator/ceph/cluster/osd/spec.go b/pkg/operator/ceph/cluster/osd/spec.go index feaf07966..2ff0d267d 100644 --- a/pkg/operator/ceph/cluster/osd/spec.go +++ b/pkg/operator/ceph/cluster/osd/spec.go @@ -22,7 +22,6 @@ import ( "path" "path/filepath" "strconv" - "strings" "github.com/libopenstorage/secrets" "github.com/pkg/errors" @@ -738,7 +737,7 @@ func (c *Cluster) getActivateOSDInitContainer(configDir, namespace, osdID string Path: filepath.Join( configDir, namespace, - strings.ReplaceAll(osdInfo.BlockPath, "/", "_"), + c.clusterInfo.FSID+"_"+osdInfo.UUID, ), Type: &hostPathType, },