RETURN(0);
/* Unpatched older servers which cannot safely support unaligned DIO
- * (osd-zfs) or i/o with page size interop issues should abort here
+ * should abort here
*/
- if (unaligned && !cl_io_top(io)->ci_allow_unaligned_dio) {
- unsigned int md0_offset;
-
- if (cl_io_top(io)->ci_target_is_zfs)
- RETURN(-EINVAL);
-
- /* unpatched ldiskfs is fine, unless MD0 does not align/fit */
- md0_offset = file_offset & (MD_MAX_INTEROP_PAGE_SIZE - 1);
- if ((count + md0_offset) >= LNET_MTU) {
- u64 iomax, iomin;
-
- iomax = cl_io_nob_aligned(file_offset, count,
- MD_MAX_INTEROP_PAGE_SIZE);
- iomin = cl_io_nob_aligned(file_offset, count,
- MD_MIN_INTEROP_PAGE_SIZE);
- if (iomax != iomin)
- RETURN(-EINVAL);
- }
- }
+ if (unaligned && !cl_io_top(io)->ci_allow_unaligned_dio)
+ RETURN(-EINVAL);
/* if one part of an I/O is unaligned, just handle all of it that way -
* otherwise we create significant complexities with managing the iovec
}
# With unaligned_dio enabled there are no restrictions on dio.
-unaligned_dio_or_ldiskfs_with_same_page_size()
+unaligned_dio_or_skip()
{
- if [[ "${ost1_FSTYPE}" == "zfs" ]]; then
- $LCTL get_param osc.*.import | grep connect_flags: |
- grep -q "unaligned_dio" ||
- skip "Need ldiskfs server or 'unaligned_dio' support"
- fi
- if [[ $(get_page_size ost1) != $PAGE_SIZE ]]; then
- $LCTL get_param osc.*.import | grep connect_flags: |
- grep -q "unaligned_dio" ||
- skip "Need page interop support"
+ if ! unaligned_dio; then
+ skip "Need 'unaligned_dio' support"
fi
}
dio_readv_writev_support()
{
# Kernels after 3.16 work:
- (( $(version_code $(uname -r)) >= $(version_code 3.16) ))
+ (( $(version_code $(uname -r)) >= $(version_code 3.16) )) &&
return 0
# Lustre with LU-17524 works:
- (( $OST1_VERSION > $(version_code 2.15.61.196) ))
+ (( $OST1_VERSION > $(version_code 2.15.61.196) )) &&
return 0
skip "need readv/writev with O_DIRECT support"
test_119e()
{
- unaligned_dio_or_ldiskfs_with_same_page_size
+ unaligned_dio_or_skip
(( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
local stripe_size=$((1024 * 1024)) #1 MiB
test_119f()
{
- unaligned_dio_or_ldiskfs_with_same_page_size
+ unaligned_dio_or_skip
(( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
local stripe_size=$((1024 * 1024)) #1 MiB
test_119g()
{
- unaligned_dio_or_ldiskfs_with_same_page_size
+ unaligned_dio_or_skip
(( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
local stripe_size=$((1024 * 1024)) #1 MiB
test_119h()
{
- unaligned_dio_or_ldiskfs_with_same_page_size
+ unaligned_dio_or_skip
(( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
local stripe_size=$((1024 * 1024)) #1 MiB
# aiocp with the '-a' option makes testing memory unaligned aio trivial
test_119i()
{
- unaligned_dio_or_ldiskfs_with_same_page_size
+ unaligned_dio_or_skip
(( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
which aiocp || skip_env "no aiocp installed"
skip "LU-18032: Unaligned AIO is disabled and may not be re-enabled"
test_119j()
{
+ unaligned_dio_or_skip
(( $LINUX_VERSION_CODE > $(version_code 4.5.0) )) ||
skip "needs kernel > 4.5.0 for ki_flags support"