ceph-csi/internal
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
..
cephfs cephfs: add mountOptions during NodeStage call 2023-06-19 09:51:40 +00:00
controller rebase: update sigs.k8s.io/controller-runtime to current version 2023-06-06 12:21:43 +00:00
csi-addons rbd: (lastSyncInfo)handle last sync duration being empty case 2023-06-23 11:23:17 +00:00
csi-common build: address interfacer warning 2023-06-05 04:49:46 +00:00
journal build: address gofmt warnings 2023-06-05 04:49:46 +00:00
kms build: address gofmt warnings 2023-06-05 04:49:46 +00:00
liveness cleanup: move log functions to new internal/util/log package 2021-08-26 09:34:05 +00:00
nfs build: address errorlint warning 2023-06-05 04:49:46 +00:00
rbd rbd: do not try to run resizefs on an encrypted BlockMode volume 2023-07-04 09:52:50 +00:00
util build: address gosec warning 2023-06-05 04:49:46 +00:00