From 13c11b681bd05fec2dabc3f35e9adca90902f207 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 6 Sep 2022 14:53:14 +0000 Subject: [PATCH] client: avoid trimming inodes on Windows On Windows, ino_t is defined as "unsigned short" (2B), which isn't large enough to hold the Ceph inodes (uint64_t). For this reason, we'll avoid using ino_t on Windows. Signed-off-by: Lucian Petrut --- src/client/Client.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 6a29f534f20..39e1f519c24 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -8368,7 +8368,7 @@ void Client::fill_statx(Inode *in, unsigned int mask, struct ceph_statx *stx) /* Type bits are always set, even when CEPH_STATX_MODE is not */ stx->stx_mode = S_IFMT & in->mode; - stx->stx_ino = use_faked_inos() ? in->faked_ino : (ino_t)in->ino; + stx->stx_ino = use_faked_inos() ? in->faked_ino : (uint64_t)in->ino; stx->stx_rdev = in->rdev; stx->stx_mask |= (CEPH_STATX_INO|CEPH_STATX_RDEV); @@ -14577,7 +14577,11 @@ out: ll_unclosed_fh_set.insert(*fhp); } + #ifdef _WIN32 + uint64_t ino = 0; + #else ino_t ino = 0; + #endif if (r >= 0) { Inode *inode = in->get(); if (use_faked_inos()) -- 2.39.5