From: izxl007 Date: Sat, 26 Jul 2025 16:18:37 +0000 (+0800) Subject: mds: fix ineffective 'false' parameter due to virtual inheritance X-Git-Tag: testing/wip-vshankar-testing-20250807.170053-debug~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce8ecd39f17126012fcb5cd3d9e094ea4994cee6;p=ceph-ci.git mds: fix ineffective 'false' parameter due to virtual inheritance In MDCacheIOContext subclasses, the track parameter, when set to false, is ignored due to C++ virtual inheritance. Only the most-derived class can initialize virtual bases. This commit ensures all subclasses adopt the default track = true, eliminating confusion and potential errors from non-functional constructor parameters. Signed-off-by: izxl007 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 3a8c4739122..f6010c0fe40 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6657,7 +6657,7 @@ struct C_IO_MDC_TruncateWriteFinish : public MDCacheIOContext { LogSegmentRef ls; uint32_t block_size; C_IO_MDC_TruncateWriteFinish(MDCache *c, CInode *i, LogSegmentRef const& l, uint32_t bs) : - MDCacheIOContext(c, false), in(i), ls(l), block_size(bs) { + MDCacheIOContext(c), in(i), ls(l), block_size(bs) { } void finish(int r) override { ceph_assert(r == 0 || r == -ENOENT); @@ -6672,7 +6672,7 @@ struct C_IO_MDC_TruncateFinish : public MDCacheIOContext { CInode *in; LogSegmentRef ls; C_IO_MDC_TruncateFinish(MDCache *c, CInode *i, LogSegmentRef const& l) : - MDCacheIOContext(c, false), in(i), ls(l) { + MDCacheIOContext(c), in(i), ls(l) { } void finish(int r) override { ceph_assert(r == 0 || r == -ENOENT); diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 62abf99e45e..100a845ea9e 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -1614,7 +1614,7 @@ private: * it'ls the lesser of two evils compared with introducing * yet another piece of (multiple) inheritance. */ -class MDCacheIOContext : public virtual MDSIOContextBase { +class MDCacheIOContext : public MDSIOContextBase { protected: MDCache *mdcache; MDSRank *get_mds() override