ceph-csi/internal/rbd
Niels de Vos 06bcf92fda rbd: do not try to run resizefs on an encrypted BlockMode volume
When a volume has AccessType=Block and is encrypted with LUKS, a resize
of the filesystem on the (decrypted) block-device is attempted. This
should not be done, as the application that requested the Block volume
is the only authoritive reader/writer of the data.

In particular VirtualMachines that use RBD volumes as a disk, usually
have a partition table on the disk, instead of only a single filesystem.
The `resizefs` command will not be able to resize the filesystem on the
block-device, as it is a partition table.

When `resizefs` fails during NodeStageVolume, the volume is unstaged and
an error is returned.

Resizing an encrypted block-device requires `cryptsetup resize` so that
the LUKS header on the RBD-image is updated with the correct size. But
there is no need to call `resizefs` in this case.

Fixes: #3945
Signed-off-by: Niels de Vos <ndevos@ibm.com>
(cherry picked from commit f60a358007)
2023-07-04 09:52:50 +00:00
..
driver rbd: migration of replication controller server 2023-06-23 06:00:40 +00:00
clone.go rbd: remove the clone in case of failure 2022-06-30 05:50:16 +00:00
controllerserver_test.go rbd: add support for rbd striping 2022-06-09 18:59:00 +00:00
controllerserver.go rbd: remove context where its not being used 2023-06-06 22:01:26 +00:00
diskusage.go rbd: implement CSI-Addons ControllerReclaimSpace 2021-12-23 17:43:23 +00:00
encryption_test.go rbd: add unit test for ParseEncryptionOpts 2023-06-06 22:01:26 +00:00
encryption.go rbd: add unit test for ParseEncryptionOpts 2023-06-06 22:01:26 +00:00
errors.go rbd: migration of replication service to csi-addon 2023-06-22 11:50:54 +00:00
globals.go rbd: add functions for initializing global variables 2021-12-10 07:35:26 +00:00
identityserver.go ci: fix all linter errors found in golangci-lint 2022-06-03 12:55:54 +00:00
migration_test.go build: address gofmt warnings 2023-06-05 04:49:46 +00:00
migration.go rbd: remove redundant util.Credentials arg from flattenRbdImage() 2022-01-06 12:28:18 +00:00
mirror.go build: address gofmt warnings 2023-06-05 04:49:46 +00:00
nodeserver_test.go rbd: add capability to automatically enable read affinity 2023-02-14 08:29:46 +00:00
nodeserver.go rbd: do not try to run resizefs on an encrypted BlockMode volume 2023-07-04 09:52:50 +00:00
rbd_attach_test.go rbd: fix parsing mapOptions 2022-03-14 15:21:25 +00:00
rbd_attach.go cleanup: ErrWaitTimeout is deprecated in k8s 1.27 2023-06-06 12:21:43 +00:00
rbd_healer.go rbd: healer detect Kubernetes version for right StagingTargetPath 2022-06-24 12:23:29 +00:00
rbd_journal.go rbd: remove context where its not being used 2023-06-06 22:01:26 +00:00
rbd_util_test.go build: address gocritic warnings 2023-06-05 04:49:46 +00:00
rbd_util.go build: address errorlint warning 2023-06-05 04:49:46 +00:00
replication.go rbd: migration of replication service to csi-addon 2023-06-22 11:50:54 +00:00
snapshot.go build: address gofmt warnings 2023-06-05 04:49:46 +00:00