Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.14.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      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.

      Attachments

        Issue Links

          Activity

            [LU-13846] move iov iter forward by ourself

            Patch has landed. If more work is needed please reopen

            simmonsja James A Simmons added a comment - Patch has landed. If more work is needed please reopen

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39565/
            Subject: LU-13846 llite: move iov iter forward by ourself
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 689714eb511d39e225da64d8bfae42a4b2554626

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39565/ Subject: LU-13846 llite: move iov iter forward by ourself Project: fs/lustre-release Branch: master Current Patch Set: Commit: 689714eb511d39e225da64d8bfae42a4b2554626

            A bit deep look when we will have this bug:

            The problem existed since kernel v3.16 from following upstream linux commit:

            commit 26978b8b4d83c46f4310b253db70fa9e65149e7c
            Author: Al Viro <viro@zeniv.linux.org.uk>
            Date:   Mon Mar 10 14:08:45 2014 -0400
                give ->direct_IO() a copy of iov_iter
                
                the thing is, we want to advance what's given to ->direct_IO() as we
                are forming the request; however, the callers care about the amount
                of data actually transferred, not the amount we tried to transfer.
                It's more convenient to allow ->direct_IO() instances do use
                iov_iter_advance() on the copy of iov_iter, leaving the actual
                advancing of the original to caller.
                
                Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
            
            wshilong Wang Shilong (Inactive) added a comment - A bit deep look when we will have this bug: The problem existed since kernel v3.16 from following upstream linux commit: commit 26978b8b4d83c46f4310b253db70fa9e65149e7c Author: Al Viro <viro@zeniv.linux.org.uk> Date: Mon Mar 10 14:08:45 2014 -0400 give ->direct_IO() a copy of iov_iter the thing is, we want to advance what's given to ->direct_IO() as we are forming the request; however, the callers care about the amount of data actually transferred, not the amount we tried to transfer. It's more convenient to allow ->direct_IO() instances do use iov_iter_advance() on the copy of iov_iter, leaving the actual advancing of the original to caller. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
            wshilong Wang Shilong (Inactive) added a comment - Patch is here: https://review.whamcloud.com/#/c/39565/2

            People

              wshilong Wang Shilong (Inactive)
              wshilong Wang Shilong (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: