diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-08-15 06:37:32 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-09-06 20:56:47 +0300 |
commit | 24d063acc26fa7ccebc7aa05498fa3818e660df6 (patch) | |
tree | 6d47f0f22cb5f538cc05e0705bfffac03f60861e /fs/ceph | |
parent | a5cd74ad388c1318554e24820b77ce335a27e0ef (diff) | |
download | linux-24d063acc26fa7ccebc7aa05498fa3818e660df6.tar.xz |
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" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 19b97b47b3c9..f1c5691e8e2c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1457,6 +1457,12 @@ retry: goto retry; } + // make sure flushsnap messages are sent in proper order. + if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) { + __kick_flushing_caps(mdsc, session, ci, 0); + ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH; + } + __ceph_flush_snaps(ci, session); out: spin_unlock(&ci->i_ceph_lock); @@ -1904,11 +1910,7 @@ ack: (ci->i_ceph_flags & (CEPH_I_KICK_FLUSH | CEPH_I_FLUSH_SNAPS))) { if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) { - spin_lock(&mdsc->cap_dirty_lock); - oldest_flush_tid = __get_oldest_flush_tid(mdsc); - spin_unlock(&mdsc->cap_dirty_lock); - __kick_flushing_caps(mdsc, session, ci, - oldest_flush_tid); + __kick_flushing_caps(mdsc, session, ci, 0); ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH; } if (ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS) |