diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-08-14 23:37:32 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-09-06 13:56:47 -0400 |
commit | 24d063acc26fa7ccebc7aa05498fa3818e660df6 (patch) | |
tree | 6d47f0f22cb5f538cc05e0705bfffac03f60861e /fs/ceph/caps.c | |
parent | a5cd74ad388c1318554e24820b77ce335a27e0ef (diff) |
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/caps.c')
-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: | |||
1457 | goto retry; | 1457 | goto retry; |
1458 | } | 1458 | } |
1459 | 1459 | ||
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 | |||
1460 | __ceph_flush_snaps(ci, session); | 1466 | __ceph_flush_snaps(ci, session); |
1461 | out: | 1467 | out: |
1462 | spin_unlock(&ci->i_ceph_lock); | 1468 | spin_unlock(&ci->i_ceph_lock); |
@@ -1904,11 +1910,7 @@ ack: | |||
1904 | (ci->i_ceph_flags & | 1910 | (ci->i_ceph_flags & |
1905 | (CEPH_I_KICK_FLUSH | CEPH_I_FLUSH_SNAPS))) { | 1911 | (CEPH_I_KICK_FLUSH | CEPH_I_FLUSH_SNAPS))) { |
1906 | if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) { | 1912 | if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) { |
1907 | spin_lock(&mdsc->cap_dirty_lock); | 1913 | __kick_flushing_caps(mdsc, session, ci, 0); |
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); | ||
1912 | ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH; | 1914 | ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH; |
1913 | } | 1915 | } |
1914 | if (ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS) | 1916 | if (ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS) |