]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix ineffective 'false' parameter due to virtual inheritance 64702/head
authorizxl007 <zeng.zheng@zte.com.cn>
Sat, 26 Jul 2025 16:18:37 +0000 (00:18 +0800)
committerizxl007 <zeng.zheng@zte.com.cn>
Sat, 26 Jul 2025 16:18:37 +0000 (00:18 +0800)
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 <zeng.zheng@zte.com.cn>
src/mds/MDCache.cc
src/mds/MDCache.h

index 3a8c47391228a9c6a003fd82f5886797e1b651ed..f6010c0fe40ebc19de11987d6f77cda1051b96b7 100644 (file)
@@ -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);
index 62abf99e45e3ff70469959669883e51eb95ffc08..100a845ea9e39dc1c9493eff4a806859976527af 100644 (file)
@@ -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