Repository navigation
Conversation
9f07560 to
b9509b3
Compare
Agreed, #71445 is the same encode fix and further along, so I've dropped mine from here. I left one comment there about the matching check in decode(). |
b9509b3 to
b22f615
Compare
|
Rebased on main, no changes. @tchaikov @wjwithagen could you take a look at the common/compat commits? Several touch the shared BSD/Darwin branches. @mattbenjamin, the one rgw_file commit is a small guard fix for the stat timespec reads. |
|
jenkins retest this please |
|
LGTM for FreeBSD |
b22f615 to
4fbff92
Compare
| static std::optional<Killer> arm(CephContext* m_cct, int signal_to_send, double delay) | ||
| { | ||
| #ifndef WIN32 | ||
| #ifdef HAVE_TIMER_CREATE |
There was a problem hiding this comment.
might want to update the #ifdef at line 1028 as well, otherwise -EAGAIN is returned.
There was a problem hiding this comment.
Good catch, thanks. That early return is now #ifndef HAVE_TIMER_CREATE, so platforms without POSIX timers get -ENOTSUP and a message saying why (as Windows already did), rather than -EAGAIN from a timer that couldn't be armed. Folded into "common: gate the admin socket raise hook on POSIX timer support". Checked on macOS: ceph daemon osd.0 raise SIGHUP --after 5 now returns (45) Operation not supported with '--after' needs POSIX per-process timers, which this platform lacks.
| #endif | ||
| #ifndef ENOKEY | ||
| #define ENOKEY 126 | ||
| #endif |
There was a problem hiding this comment.
the commit message reads:
The fscrypt paths return -ENOKEY for a missing key, and fuse_ll.cc maps it in cephfs_errno_to_system_errno. Darwin has no such errno, so the translation unit does not compile there at all.
but please note, the fuse_ll.cc entry is already behind #if defined(ENOKEY). i think the uses that break the build are Client.cc, FSCrypt.cc and rgw_sal_posix.cc. could you please help confirm and update the message to name those instead?
There was a problem hiding this comment.
Confirmed: fuse_ll.cc is guarded, and the uses that break the build are Client.cc (3), FSCrypt.cc and rgw_sal_posix.cc, plus the tests test/common/test_keyring.cc and test/libcephfs/fscrypt.cc. The commit message names those now, and notes that the guarded fuse_ll.cc entry now applies on Darwin too.
compat.h only forward declared cpu_set_t on Darwin, which is not enough for the callers that have to declare one - OSD::numa_cpu_set is a member, and OSDMonitor has a local. Define it, shaped like the Windows shim further down the file; numa.cc's non-Linux stubs never inspect the value. PROCPREFIX was defined for Linux and FreeBSD only, so the /proc readers in common/util.cc and common/MemoryModel.h did not compile anywhere else. Darwin has no procfs; define it empty so they build and fail at runtime instead, which they already handle. off64_t goes next to the existing lseek64 shim. Darwin's off_t is already 64 bits wide, and include/types.h has the same typedef for callers that include it instead. numa.h has to include compat.h to see cpu_set_t, as it already does on Windows. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
memset_s() is only declared when __STDC_WANT_LIB_EXT1__ is defined before <string.h> is first included. compat.cc did define it, but only just above its own #include <string.h>, by which point include/compat.h at the top of the file had already pulled <string.h> in and the include guard made the second one a no-op. ceph_memzero_s() then failed to compile wherever HAVE_MEMSET_S was set. Move the feature macro above the first include. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
Darwin has no Linux struct tcp_info and none of the TCP_* connection state constants; it exposes connection statistics as struct tcp_connection_info via TCP_CONNECTION_INFO, which shares no fields with the Linux structure. Reuse the stub the Windows build already uses. Mapping the Darwin structure onto the same formatter keys would be a reasonable follow-up. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
block_device_run_smartctl(), block_device_get_metrics() and block_device_run_nvme() are defined in the Linux, FreeBSD and generic branches of blkdev.cc, but not in the Darwin one, so anything linking libmon or libosd failed with undefined symbols. Add the same -EOPNOTSUPP stubs the generic branch uses. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
The rgw needs posix_fadvise(2), which Darwin does not have. The call is purely advisory - it hints the page cache and nothing more - so ignoring it is a faithful degradation, and it is what the bundled RocksDB already does on this platform. Keep the Linux numbering for the POSIX_FADV_* values, because they reach the callers through configuration options (rgw_d3n_l1_fadvise, rgw_d4n_l1_fadvise) rather than as literals. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
The fscrypt code in the client (Client.cc, FSCrypt.cc) and the RGW POSIX driver (rgw_sal_posix.cc) return -ENOKEY for a missing key, and the fscrypt and keyring tests expect it. Darwin has no such errno, so those translation units do not compile there. (fuse_ll.cc already guards its entry in cephfs_errno_to_system_errno with #if defined(ENOKEY); with the define, that entry now applies on Darwin too.) Define it beside the EUCLEAN, EREMOTEIO and EKEYREJECTED fallbacks that are already in the Darwin block, keeping the Linux value 126 the way those keep theirs - the value matters, because it is what arrives over the wire and what common/darwin_errno.cc converts from. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
RaiseHook arms a POSIX per-process timer to deliver a delayed signal. The code was gated on !WIN32, but Windows is not the only platform without timer_create(2) - Darwin does not implement POSIX timers either. Probe for timer_create() and gate on that. _POSIX_TIMERS is not a usable proxy: Darwin defines it as -1, which per POSIX means the feature is declared but unsupported. Refuse "raise --after" with -ENOTSUP wherever the timer is not built, as Windows already did, rather than failing to arm it and returning -EAGAIN. acconfig.h has to be included explicitly, because admin_socket.h does not pull it in and the macro would otherwise be invisible everywhere, quietly disabling the hook on platforms that do support timers. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
The four AdminSocketRaise tests that exercise "raise --after" were skipped on Windows only. The asok raise hook now builds its delayed path only when HAVE_TIMER_CREATE, since Darwin, like Windows, does not implement the POSIX per-process timers, and there the tests hang until they time out. Skip on the same condition the hook is compiled under, and keep the WIN32 check in StopCont, which additionally needs SIGSTOP and SIGCONT. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
The !HAVE_GETENTROPY && !_WIN32 branch defines the CryptoRandom members without opening namespace TOPNSPC::auth, while the #endif that follows all three branches closes it. The branch therefore cannot compile. Both of the other branches open the namespace, and no platform built in CI takes this one, so the mistake went unnoticed. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
rgw_file_int.h already spells the timespec members both ways where it writes them, under HAVE_STAT_ST_MTIMESPEC_TV_NSEC, because Darwin calls them st_atimespec rather than st_atim. The two places that read them were missed and name the Linux members directly. Use the same guard, so the file is consistent with itself. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
4fbff92 to
c8705e8
Compare
Split out of #71232, which reviewers asked to see in smaller batches.
Based on main; independent of the other six. The macOS build also needs
@tchaikov's #72482 (endian macros) and #72484 (unversioned object class
libraries).
src/include/compat.hand friends already carry a Darwin branch; it isjust missing pieces. This fills them in, and fixes a few things that are
not additions:
compat.h: the definitions the Darwin branch was missing, thefadvisefallback, and
ENOKEY;numa.hincluding it forcpu_set_tcompat.cc:__STDC_WANT_LIB_EXT1__defined before the first<string.h>, not afterblkdev.cc: the three helpers the Darwin branch does not definetcp_info.cc: stubbed, as on Windows — Darwin'sstruct tcp_connection_infoshares no fields with Linux'tcp_infoadmin_socket.cc: the raise hook gated on a newHAVE_TIMER_CREATErather than on
!WIN32, since POSIX per-process timers are what itactually needs; where they are absent,
raise --afterfails with-ENOTSUP(as on Windows) and the corresponding tests are skippedauth/Crypto.cc: the/dev/urandomfallback opened in the rightnamespace
rgw_file: two reads of the stat timespecs going through the sameHAVE_STAT_ST_MTIMESPEC_TV_NSECguard the writes in the same filealready use
The
entity_addr_tencoding fix on the BSDs that was here has beendropped in favour of @wjwithagen's #71445, which fixes it the same way.
Likewise the Darwin endian fallbacks and a
ClassHandler.ccchange to skipversioned
libcls_*.dylibnames, in favour of #72482 and #72484, whichremove the need for them.
Checklist