summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-01-23 21:02:32 -0500
committerIlya Dryomov <idryomov@gmail.com>2017-02-20 06:16:07 -0500
commit00f06cba53f53f3f7be8ac4f9ba2c2f6a94bca6f (patch)
tree91550b4cbfd922e253687dc7402b5b262a9be35e /fs/ceph/caps.c
parentd641df819db8b80198fd85d9de91137e8a823b07 (diff)
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: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index d941c48e8bff..ed8c7addce91 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3410,6 +3410,7 @@ retry:
3410 tcap->implemented |= issued; 3410 tcap->implemented |= issued;
3411 if (cap == ci->i_auth_cap) 3411 if (cap == ci->i_auth_cap)
3412 ci->i_auth_cap = tcap; 3412 ci->i_auth_cap = tcap;
3413
3413 if (!list_empty(&ci->i_cap_flush_list) && 3414 if (!list_empty(&ci->i_cap_flush_list) &&
3414 ci->i_auth_cap == tcap) { 3415 ci->i_auth_cap == tcap) {
3415 spin_lock(&mdsc->cap_dirty_lock); 3416 spin_lock(&mdsc->cap_dirty_lock);
@@ -3423,9 +3424,18 @@ retry:
3423 } else if (tsession) { 3424 } else if (tsession) {
3424 /* add placeholder for the export tagert */ 3425 /* add placeholder for the export tagert */
3425 int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0; 3426 int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0;
3427 tcap = new_cap;
3426 ceph_add_cap(inode, tsession, t_cap_id, -1, issued, 0, 3428 ceph_add_cap(inode, tsession, t_cap_id, -1, issued, 0,
3427 t_seq - 1, t_mseq, (u64)-1, flag, &new_cap); 3429 t_seq - 1, t_mseq, (u64)-1, flag, &new_cap);
3428 3430
3431 if (!list_empty(&ci->i_cap_flush_list) &&
3432 ci->i_auth_cap == tcap) {
3433 spin_lock(&mdsc->cap_dirty_lock);
3434 list_move_tail(&ci->i_flushing_item,
3435 &tcap->session->s_cap_flushing);
3436 spin_unlock(&mdsc->cap_dirty_lock);
3437 }
3438
3429 __ceph_remove_cap(cap, false); 3439 __ceph_remove_cap(cap, false);
3430 goto out_unlock; 3440 goto out_unlock;
3431 } 3441 }