提交 00f06cba 编写于 作者: Y Yan, Zheng 提交者: Ilya Dryomov

ceph: make sure flushing inode in proper session's cap_flushing list

when flushing inode's auth cap changes, we need to move it into the
new auth cap session's cap_flushing list
Signed-off-by: NYan, Zheng <zyan@redhat.com>
上级 d641df81
...@@ -3410,6 +3410,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, ...@@ -3410,6 +3410,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
tcap->implemented |= issued; tcap->implemented |= issued;
if (cap == ci->i_auth_cap) if (cap == ci->i_auth_cap)
ci->i_auth_cap = tcap; ci->i_auth_cap = tcap;
if (!list_empty(&ci->i_cap_flush_list) && if (!list_empty(&ci->i_cap_flush_list) &&
ci->i_auth_cap == tcap) { ci->i_auth_cap == tcap) {
spin_lock(&mdsc->cap_dirty_lock); spin_lock(&mdsc->cap_dirty_lock);
...@@ -3423,9 +3424,18 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, ...@@ -3423,9 +3424,18 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
} else if (tsession) { } else if (tsession) {
/* add placeholder for the export tagert */ /* add placeholder for the export tagert */
int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0; int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0;
tcap = new_cap;
ceph_add_cap(inode, tsession, t_cap_id, -1, issued, 0, ceph_add_cap(inode, tsession, t_cap_id, -1, issued, 0,
t_seq - 1, t_mseq, (u64)-1, flag, &new_cap); t_seq - 1, t_mseq, (u64)-1, flag, &new_cap);
if (!list_empty(&ci->i_cap_flush_list) &&
ci->i_auth_cap == tcap) {
spin_lock(&mdsc->cap_dirty_lock);
list_move_tail(&ci->i_flushing_item,
&tcap->session->s_cap_flushing);
spin_unlock(&mdsc->cap_dirty_lock);
}
__ceph_remove_cap(cap, false); __ceph_remove_cap(cap, false);
goto out_unlock; goto out_unlock;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册