learn.rahul.rai@gmail.com has uploaded this change for review.
GTest: initialize FSAL I/O arguments in latency tests
In test_read2_latency.cc and test_write2_latency.cc, struct fsal_io_arg defines iov as a pointer (struct iovec *iov). The tests attempted flexible-array allocation via alloca() without assigning arg.iov to valid memory, causing a segmentation fault when accessing iov[0]. Additionally, fsal_resume contained uninitialized stack memory.
Fix this by zero-initializing fsal_io_arg with memset, assigning arg.iov to a local struct iovec, setting iov_count to 1 and io_request to the requested length, and ensuring fsal_resume starts at FSAL_NORESUME (0).
Change-Id: I002ec458ecee9c84bea25267ff044f64fd8259f4
Signed-off-by: Rahul Rai <learn.rahul.rai@gmail.com>
---
M src/gtest/fsal_api/test_read2_latency.cc
M src/gtest/fsal_api/test_write2_latency.cc
2 files changed, 228 insertions(+), 215 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/47/1255847/1
To view, visit change 1255847. To unsubscribe, or for help writing mail filters, visit settings.