Skip to content

Commit 76eab17

Browse files
committed
mds: add mds_lock asserts for journal flush
Signed-off-by: Patrick Donnelly <[email protected]>
1 parent ddc5594 commit 76eab17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mds/MDSRank.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class C_Flush_Journal : public MDSInternalContext {
7171
}
7272

7373
void send() {
74-
ceph_assert(ceph_mutex_is_locked(mds->mds_lock));
74+
ceph_assert(ceph_mutex_is_locked_by_me(mds->mds_lock));
7575

7676
dout(20) << __func__ << dendl;
7777

@@ -112,6 +112,7 @@ class C_Flush_Journal : public MDSInternalContext {
112112
}
113113

114114
void handle_clear_mdlog(int r) {
115+
ceph_assert(ceph_mutex_is_locked_by_me(mds->mds_lock));
115116
dout(20) << __func__ << ": r=" << r << dendl;
116117

117118
if (r != 0) {
@@ -181,6 +182,7 @@ class C_Flush_Journal : public MDSInternalContext {
181182
}
182183

183184
void trim_expired_segments() {
185+
ceph_assert(ceph_mutex_is_locked_by_me(mds->mds_lock));
184186
dout(5) << __func__ << ": expiry complete, expire_pos/trim_pos is now "
185187
<< std::hex << mdlog->get_journaler()->get_expire_pos() << "/"
186188
<< mdlog->get_journaler()->get_trimmed_pos() << dendl;
@@ -218,6 +220,7 @@ class C_Flush_Journal : public MDSInternalContext {
218220
}
219221

220222
void finish(int r) override {
223+
ceph_assert(!ceph_mutex_is_locked_by_me(mds->mds_lock));
221224
dout(20) << __func__ << ": r=" << r << dendl;
222225
on_finish->complete(r);
223226
}

0 commit comments

Comments
 (0)