Skip to content

Commit da9096b

Browse files
authored
Merge pull request #503 from siyanshen/mountOptions
Increase buffer size in Recvmsg to allow for longer mountOptions
2 parents dbfe268 + feb6f75 commit da9096b

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

pkg/util/fdchannel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ func RecvMsg(via net.Conn) (int, []byte, error) {
5959

6060
klog.V(4).Info("calling recvmsg...")
6161
buf := make([]byte, syscall.CmsgSpace(4))
62-
b := make([]byte, 500)
62+
b := make([]byte, 5000)
6363
//nolint:dogsled
6464
n, _, _, _, err := syscall.Recvmsg(socket, b, buf, 0)
6565
if err != nil {
6666
return 0, nil, err
6767
}
68+
klog.V(4).Infof("received message of %d bytes", n)
6869

6970
klog.V(4).Info("parsing SCM...")
7071
var msgs []syscall.SocketControlMessage

test/e2e/specs/testdriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func (n *GCSFuseCSITestDriver) createBucket(ctx context.Context, serviceAccountN
436436
// so there is no need to check if the bucket already exists
437437
newBucket := &storage.ServiceBucket{
438438
Project: n.meta.GetProjectID(),
439-
Name: uuid.NewString(),
439+
Name: "gcsfusecsi-testsuite-gen-" + uuid.NewString(),
440440
Location: n.bucketLocation,
441441
EnableUniformBucketLevelAccess: true,
442442
EnableHierarchicalNamespace: n.EnableHierarchicalNamespace,

test/e2e/testsuites/mount.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,26 @@ func (t *gcsFuseCSIMountTestSuite) DefineTests(driver storageframework.TestDrive
163163
tPod.Cleanup(ctx)
164164
}
165165

166+
testCaseLongMountOptions := func(configPrefix ...string) {
167+
init(configPrefix...)
168+
defer cleanup()
169+
170+
ginkgo.By("Configuring pod with long mount options")
171+
tPod := specs.NewTestPod(f.ClientSet, f.Namespace)
172+
// this will result in a byte > 500 message
173+
longMountOptions := "metadata-cache:ttl-secs:-1,metadata-cache:stat-cache-max-size-mb:-1," + "metadata-cache:type-cache-max-size-mb:-1,file-system:kernel-list-cache-ttl-secs:-1,gcs-connection:client-protocol:grpc,write:enable-streaming-writes:true,file-cache:enable-parallel-downloads:true,file-cache:parallel-downloads-per-file:100,file-cache:max-parallel-downloads:-1,file-cache:download-chunk-size-mb:10,file-cache:max-size-mb:-1"
174+
ginkgo.By("Mount option length: " + strconv.Itoa(len(longMountOptions)))
175+
tPod.SetupVolume(l.volumeResource, volumeName, mountPath, false, longMountOptions)
176+
177+
tPod.Create(ctx)
178+
179+
ginkgo.By("Checking pod is running")
180+
tPod.WaitForRunning(ctx)
181+
182+
ginkgo.By("Deleting pod")
183+
tPod.Cleanup(ctx)
184+
}
185+
166186
ginkgo.It("[read ahead config] should update read ahead config knobs", func() {
167187
if pattern.VolType == storageframework.DynamicPV {
168188
e2eskipper.Skipf("skip for volume type %v", storageframework.DynamicPV)
@@ -180,4 +200,11 @@ func (t *gcsFuseCSIMountTestSuite) DefineTests(driver storageframework.TestDrive
180200
ginkgo.By("Skipping the hostnetwork test for cluster version < 1.33.0")
181201
}
182202
})
203+
204+
ginkgo.It("should successfully mount with long mount options", func() {
205+
if pattern.VolType == storageframework.DynamicPV {
206+
e2eskipper.Skipf("skip for volume type %v", storageframework.DynamicPV)
207+
}
208+
testCaseLongMountOptions()
209+
})
183210
}

0 commit comments

Comments
 (0)