Closed tontinton closed 8 months ago
Two minor things:
1) The prep helper should go into the ffi as well, and the ffi map (in the 2.6 section). See src/liburing-ffi.map. 2) The test case tests functionality, which is great, but it should also the failure case. Since we're potentially adding truncate support later where we'll put the path in sqe->addr, add a test case that issues an sqe where addr is set to a filename and verify that it fails with EINVAL.
I think this looks fine, but one problem is that if you run this test case on an older kernel, then the test will fail. If you get -EINVAL for the first ftruncate you try, just assume the kernel doesn't support it and return T_EXIT_SKIP for that and skip the other tests. That way it'll just skip the test case on older kernels, but test it on newer kernels.
See other test cases that do this very thing, usually with a static int no_ftruncate
global that can be set by the first test invocation, and then checked again for non-zero when that first test case returns. If true, then it should return T_EXIT_SKIP.
It already runs goto out
which returns 0, when ftruncate is not supported.
It already runs goto out which returns 0, when ftruncate is not supported.
It does, but it doesn't return T_EXIT_SKIPPED. I think you should also distinguish between "we got EBADF/EINVAL on the first test, it's probably not supported, T_EXIT_SKIPPED" rather than just have any of the test cases returning EINVAL leading to a skipped test where it probably should've been a failure.
To accompany the patches I sent for adding ftruncate, here are the changes for usermode.
git request-pull output:
Click to show/hide pull request guidelines
## Pull Request Guidelines 1. To make everyone easily filter pull request from the email notification, use `[GIT PULL]` as a prefix in your PR title. ``` [GIT PULL] Your Pull Request Title ``` 2. Follow the commit message format rules below. 3. Follow the Linux kernel coding style (see: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst). ### Commit message format rules: 1. The first line is title (don't be more than 72 chars if possible). 2. Then an empty line. 3. Then a description (may be omitted for truly trivial changes). 4. Then an empty line again (if it has a description). 5. Then a `Signed-off-by` tag with your real name and email. For example: ``` Signed-off-by: Foo BarBy submitting this pull request, I acknowledge that: