Project

General

Profile

Actions

Bug #64659

open

mds: switch to using xlists instead of elists

Added by Dhairya Parmar 2 months ago. Updated 22 days ago.

Status:
New
Priority:
Normal
Category:
Correctness/Safety
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

elist(size_t o) : _head(NULL), item_offset(o) {}
~elist() { 
  ceph_assert(_head.empty());
}

working with elist might lead to severe consequences at times if the same class member is used to initialise multiple elists e.g. [0]. Not only one needs to be highly careful while working with elist but it also induces space overhead where one might need to construct an extra elist to feed its offset the created elist so that no two elists make use of same elist.

while the `xlist` is comparatively simple:

xlist() : _front(0), _back(0), _size(0) {}
~xlist() { 
  ceph_assert(_size == 0);
  ceph_assert(_front == 0);
  ceph_assert(_back == 0);
}

Only MDS code makes use of elists as of now, I think it will be a good step to refactor MDS code to make use of xlist which will help prevent bugs like [0], make code simpler and efficient.

[0] https://tracker.ceph.com/issues/64008
[1] https://tracker.ceph.com/issues/64008#note-9


Related issues 1 (1 open0 closed)

Related to CephFS - Bug #64008: mds: CInode::item_caps used in two different listsPending BackportDhairya Parmar

Actions
Actions

Also available in: Atom PDF