Merge pull request #69466 from kotreshhr/fs-mirror-stale-stat-size

tools/cephfs-mirror: Fix truncated sync from stale crawl-time file size

Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Venky Shankar 2026-07-16 11:38:26 +05:30 committed by GitHub
commit 1bc793d81c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2468,7 +2468,7 @@ int PeerReplayer::SnapDiffSync::init_sync() {
int r = ceph_fstatx(m_local, m_fh->c_fd, &tstx,
CEPH_STATX_MODE | CEPH_STATX_UID | CEPH_STATX_GID |
CEPH_STATX_SIZE | CEPH_STATX_ATIME | CEPH_STATX_MTIME,
AT_STATX_DONT_SYNC | AT_SYMLINK_NOFOLLOW);
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to stat snap=" << m_current.first << ": " << cpp_strerror(r)
<< dendl;
@ -2635,7 +2635,7 @@ int PeerReplayer::SnapDiffSync::get_entry(std::string *epath, struct ceph_statx
r = ceph_statxat(m_local, m_fh->c_fd, _epath.c_str(), &estx,
CEPH_STATX_MODE | CEPH_STATX_UID | CEPH_STATX_GID |
CEPH_STATX_SIZE | CEPH_STATX_ATIME | CEPH_STATX_MTIME,
AT_STATX_DONT_SYNC | AT_SYMLINK_NOFOLLOW);
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to stat epath=" << epath << ", r=" << r << dendl;
return r;
@ -2811,7 +2811,7 @@ int PeerReplayer::RemoteSync::init_sync() {
int r = ceph_fstatx(m_local, m_fh->c_fd, &tstx,
CEPH_STATX_MODE | CEPH_STATX_UID | CEPH_STATX_GID |
CEPH_STATX_SIZE | CEPH_STATX_ATIME | CEPH_STATX_MTIME,
AT_STATX_DONT_SYNC | AT_SYMLINK_NOFOLLOW);
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to stat snap=" << m_current.first << ": " << cpp_strerror(r)
<< dendl;
@ -2878,7 +2878,7 @@ int PeerReplayer::RemoteSync::get_entry(std::string *epath, struct ceph_statx *s
r = ceph_statxat(m_local, m_fh->c_fd, _epath.c_str(), &cstx,
CEPH_STATX_MODE | CEPH_STATX_UID | CEPH_STATX_GID |
CEPH_STATX_SIZE | CEPH_STATX_ATIME | CEPH_STATX_MTIME,
AT_STATX_DONT_SYNC | AT_SYMLINK_NOFOLLOW);
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to stat epath=" << _epath << ": " << cpp_strerror(r)
<< dendl;