Whamcloud - gitweb
LU-13846 llite: move iov iter forward by ourself 65/39565/9
authorWang Shilong <wshilong@ddn.com>
Sat, 1 Aug 2020 12:29:47 +0000 (20:29 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Sep 2020 03:43:23 +0000 (03:43 +0000)
commit689714eb511d39e225da64d8bfae42a4b2554626
tree8a182fcd2b878a8904a05e430b033dce29c3a1af
parentdb6f203965d9173c3128c8d1c6188d2f63bc1b3e
LU-13846 llite: move iov iter forward by ourself

Newer kernel will reward iov iter back to original
position for direct IO, see following codes:

        iov_iter_revert(from, write_len -
                        iov_iter_count(from));--------->here
out:
        return written;
}
EXPORT_SYMBOL(generic_file_direct_write);

This break assumptions from Lustre and caused problem
when Lustre need split one IO to several io loop, considering
4M block IO for 1 MiB stripe file, it will submit first 1MiB IO
4 times and caused data corruptions finally.

Since generic kernel varies from different kernel versions,
we'd better fix this problem by move iov iter forward by
Lustre itself.

Added a new test cases aiocp.c is copied from xfstests,
with codes style cleanups to make checkpatch.pl happy.

Change-Id: Iab5d8f1bb0e74ed49c821c81b734c68770edf4a8
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/39565
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build.m4
lustre/autoconf/lustre-core.m4
lustre/llite/vvp_io.c
lustre/tests/Makefile.am
lustre/tests/aiocp.c [new file with mode: 0644]
lustre/tests/sanity.sh