rbd: do not resize read-only volumes while staging

Volumes that were requested with a read-only capability should not be
resized.

Reported-by: Alex Kalenyuk <akalenyu@redhat.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2025-04-24 17:15:02 +02:00 committed by mergify[bot]
parent ea7be34396
commit 31da09863e

View File

@ -474,6 +474,8 @@ func (ns *NodeServer) stageTransaction(
} }
} }
// if the volume is read-only, no resize should be done
if !volOptions.readOnly {
// As we are supporting the restore of a volume to a bigger size and // As we are supporting the restore of a volume to a bigger size and
// creating bigger size clone from a volume, we need to check filesystem // creating bigger size clone from a volume, we need to check filesystem
// resize is required, if required resize filesystem. // resize is required, if required resize filesystem.
@ -482,6 +484,7 @@ func (ns *NodeServer) stageTransaction(
if err != nil { if err != nil {
return transaction, err return transaction, err
} }
}
return transaction, err return transaction, err
} }