Skip to content

Commit e437d24

Browse files
committed
remove noload for SharedFS read-only mounts
1 parent 31227d1 commit e437d24

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

internal/node/fs/fs_node.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ func (d *Node) NodePublishVolume(ctx context.Context, request *csi.NodePublishVo
6969

7070
if request.GetReadonly() {
7171
// Read-only volumes cannot be written to in any way
72-
// We should not attempt to replay the journal
73-
mountOpts = append(mountOpts, node.ReadOnlyMountOption, node.NoLoadMountOption)
72+
mountOpts = append(mountOpts, node.ReadOnlyMountOption)
7473
}
7574

7675
err = nodePublishVolume(d.Mounter, d.Resizer, mountOpts, nfsEnabled, d.NFSRemotePorts, d.NFSHost, request)

internal/node/ssd/ssd_node.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ func (d *Node) NodePublishVolume(_ context.Context, request *csi.NodePublishVolu
5757

5858
if request.GetReadonly() {
5959
// Read-only volumes cannot be written to in any way
60-
// We should not attempt to replay the journal
61-
mountOpts = append(mountOpts, node.ReadOnlyMountOption, node.NoLoadMountOption)
60+
mountOpts = append(mountOpts, node.ReadOnlyMountOption)
61+
62+
if mountCap := request.GetVolumeCapability().GetMount(); mountCap != nil {
63+
fsType := mountCap.GetFsType()
64+
if fsType == "ext4" {
65+
mountOpts = append(mountOpts, node.NoLoadMountOption)
66+
}
67+
}
6268
}
6369

6470
err := nodePublishVolume(d.Mounter, d.Resizer, mountOpts, request)

0 commit comments

Comments
 (0)