Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141371

::copy_file_range falsely(?) returns only TriStateResult::Failed on failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.10.1, 6.11.0 Beta3
    • 6.10.0
    • Core: I/O
    • None
    • Linux/Wayland, Linux/X11, Linux/Other display system
    • c63b68dab (dev), a60364183 (6.10)

      https://bbs.archlinux.org/viewtopic.php?pid=2268636#p2268636

      The gist is akonadi failing to copy an old error log on a somewhat exotic ecryptfs+xfs w/ a qt6-base update 6.9 to 6.10 (still works w/ ext4, not clear whether ecryptfs or xfs or the combination is the problem)

       

      strace shows that QFileSystemEngine::cloneFile used to fail FICLONE with ENOSUPP, then sendfile w/ EINVAL and then the file gets manually read/written into a qt_temp.HqmGfm tmpfile and the inode linked to Akonadi.error.old

      Now FICLONE is still ENOSUPP, then ::copy_file_range fails w/ EINVAL what in https://github.com/qt/qtbase/blob/58faca4e07011510388df94ddea2f95b56750bae/src/corelib/io/qfilesystemengine_unix.cpp#L1201 returns TriStateResult::Failed but from the below comment at https://github.com/qt/qtbase/blob/58faca4e07011510388df94ddea2f95b56750bae/src/corelib/io/qfilesystemengine_unix.cpp#L1217 this should probably be TriStateResult::NotSupported to resort to the upper layer copy as it probably used to w/ the previous ::sendfile failure (or even try sendfile first?)

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            lbkng Thomas Lübking
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes