Skip to content

Commit 24d063a

Browse files
ukernelidryomov
authored andcommitted
ceph: make sure flushsnap messages are sent in proper order
Before sending new flushsnap message, check if there are old flushsnap messages that need to be re-sent. If there are, re-send old messages first. This guarantees ordering of flushsnap messages. Signed-off-by: "Yan, Zheng" <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent a5cd74a commit 24d063a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fs/ceph/caps.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,12 @@ void ceph_flush_snaps(struct ceph_inode_info *ci,
14571457
goto retry;
14581458
}
14591459

1460+
// make sure flushsnap messages are sent in proper order.
1461+
if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) {
1462+
__kick_flushing_caps(mdsc, session, ci, 0);
1463+
ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH;
1464+
}
1465+
14601466
__ceph_flush_snaps(ci, session);
14611467
out:
14621468
spin_unlock(&ci->i_ceph_lock);
@@ -1904,11 +1910,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
19041910
(ci->i_ceph_flags &
19051911
(CEPH_I_KICK_FLUSH | CEPH_I_FLUSH_SNAPS))) {
19061912
if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) {
1907-
spin_lock(&mdsc->cap_dirty_lock);
1908-
oldest_flush_tid = __get_oldest_flush_tid(mdsc);
1909-
spin_unlock(&mdsc->cap_dirty_lock);
1910-
__kick_flushing_caps(mdsc, session, ci,
1911-
oldest_flush_tid);
1913+
__kick_flushing_caps(mdsc, session, ci, 0);
19121914
ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH;
19131915
}
19141916
if (ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)

0 commit comments

Comments
 (0)