]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/client: When testing large io, consider fscrypt
authorChristopher Hoffman <choffman@redhat.com>
Mon, 20 Oct 2025 18:33:17 +0000 (18:33 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:36 +0000 (13:59 +0000)
When testing large io sizes and clamping that io, consider
fscrypt max io size. This max io size should be a multiple
of 4K (fscrypt block size), but not to exceed INT_MAX.

Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/test/client/CMakeLists.txt
src/test/client/nonblocking.cc
src/test/client/syncio.cc

index 00c0681f8b9c1c9bbd31a406707f960d5302002c..ed233fb887db5e2949fd3cadf3352a9d06b0133e 100644 (file)
@@ -26,6 +26,7 @@ if(${WITH_CEPHFS})
     ops.cc
     nonblocking.cc
     fscrypt_conf.cc
+    syncio.cc
     )
   target_link_libraries(ceph_test_client_fscrypt
     client
index c232c2ffcc0c81b03d7bd39f203037f220fb5444..8a877c6b03b9f09bc2ce9b18e04cb72bf3f0bd1f 100644 (file)
@@ -777,15 +777,21 @@ TEST_F(TestClient, LlreadvLlwritevLargeBuffers) {
                                  nullptr);
   ASSERT_EQ(rc, 0);
   bytes_written = writefinish.wait();
+
+  int maxio_size = INT_MAX;
+  if (fse.encrypted) {
+    maxio_size = FSCRYPT_MAXIO_SIZE;
+  }
+
   // total write length is clamped to INT_MAX in write paths
-  ASSERT_EQ(bytes_written, INT_MAX);
+  ASSERT_EQ(bytes_written, maxio_size);
 
   rc = client->ll_preadv_pwritev(fh, iov_in, 2, 0, false, &readfinish, &bl);
   ASSERT_EQ(rc, 0);
   bytes_read = readfinish.wait();
   // total read length is clamped to INT_MAX in read paths
-  ASSERT_EQ(bytes_read, INT_MAX);
+  ASSERT_EQ(bytes_read, maxio_size);
 
   client->ll_release(fh);
   ASSERT_EQ(0, client->ll_unlink(root, filename, myperm));
-}
\ No newline at end of file
+}
index 0eddc2ddae9ff39d43f5f48a278e4a6ecb43e1fb..a82c7210dddd0cd0c627cf31912dad2321ebb943 100644 (file)
@@ -129,13 +129,19 @@ TEST_F(TestClient, LlreadvLlwritevLargeBuffersSync) {
     {in_buf_1.get(), BUFSIZE}
   };
 
+  int maxio_size = INT_MAX;
+  if (fse.encrypted) {
+    maxio_size = FSCRYPT_MAXIO_SIZE;
+  }
+
+
   rc = client->ll_writev(fh, iov_out, 2, 0);
   // total write length is clamped to INT_MAX in write paths
-  ASSERT_EQ(rc, INT_MAX);
+  ASSERT_EQ(rc, maxio_size);
 
   rc = client->ll_readv(fh, iov_in, 2, 0);
   // total write length is clamped to INT_MAX in write paths
-  ASSERT_EQ(rc, INT_MAX);
+  ASSERT_EQ(rc, maxio_size);
 
   client->ll_release(fh);
   ASSERT_EQ(0, client->ll_unlink(root, filename, myperm));