diff options
author | Niall Douglas <s_github@nedprod.com> | 2022-10-07 22:54:53 +0300 |
---|---|---|
committer | Niall Douglas <s_github@nedprod.com> | 2022-10-07 22:54:53 +0300 |
commit | 2eec8aaae24305c6fbf4a05df61339b22b5c80e7 (patch) | |
tree | 83e0cbf3f74bb8519ad541a092db7e3cdc7587d9 | |
parent | 519777ecc609fe9a7e10f5444ccb30819df51913 (diff) |
Last commit didn't actually log the warning as it was supposed to, fixed.
-rw-r--r-- | include/llfio/v2.0/detail/impl/posix/file_handle.ipp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp index 8c2e4c6f..9e4ddd82 100644 --- a/include/llfio/v2.0/detail/impl/posix/file_handle.ipp +++ b/include/llfio/v2.0/detail/impl/posix/file_handle.ipp @@ -820,20 +820,22 @@ result<file_handle::extent_pair> file_handle::clone_extents_to(file_handle::exte auto bytes_cloned = _copy_file_range(_v.fd, &off_in, dest.native_handle().fd, &off_out, thisblock, 0); if(bytes_cloned <= 0) { - if(bytes_cloned < 0 && - ((EXDEV != errno && EOPNOTSUPP != errno && ENOSYS != errno && EINVAL != errno /* bug in lustre */) || !emulate_if_unsupported)) + if(bytes_cloned < 0) { - auto errcode = errno; - if(EINVAL == errcode) + if(((EXDEV != errno && EOPNOTSUPP != errno && ENOSYS != errno && EINVAL != errno /* bug in lustre */) || !emulate_if_unsupported)) + { + return posix_error(); + } + if(EINVAL == errno) { static std::atomic<bool> einval_seen{false}; bool expected = false; if(einval_seen.compare_exchange_strong(expected, true, std::memory_order_acq_rel, std::memory_order_relaxed)) { - LLFIO_LOG_WARN(this, "Treating copy_file_range() returning EINVAL as a kernel filesystem bug, not as a bug in LLFIO's file_handle::clone_extents()!"); + LLFIO_LOG_WARN( + this, "Treating copy_file_range() returning EINVAL as a kernel filesystem bug, not as a bug in LLFIO's file_handle::clone_extents()!"); } } - return posix_error(errcode); } duplicate_extents = false; // emulate using copy of bytes } |