diff options
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 73c153092f72..5e9da996a151 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2283,7 +2283,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2283 | { | 2283 | { |
2284 | struct ceph_inode_info *ci = ceph_inode(inode); | 2284 | struct ceph_inode_info *ci = ceph_inode(inode); |
2285 | int mds = session->s_mds; | 2285 | int mds = session->s_mds; |
2286 | int seq = le32_to_cpu(grant->seq); | 2286 | unsigned seq = le32_to_cpu(grant->seq); |
2287 | unsigned issue_seq = le32_to_cpu(grant->issue_seq); | ||
2287 | int newcaps = le32_to_cpu(grant->caps); | 2288 | int newcaps = le32_to_cpu(grant->caps); |
2288 | int issued, implemented, used, wanted, dirty; | 2289 | int issued, implemented, used, wanted, dirty; |
2289 | u64 size = le64_to_cpu(grant->size); | 2290 | u64 size = le64_to_cpu(grant->size); |
@@ -2295,8 +2296,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2295 | int revoked_rdcache = 0; | 2296 | int revoked_rdcache = 0; |
2296 | int queue_invalidate = 0; | 2297 | int queue_invalidate = 0; |
2297 | 2298 | ||
2298 | dout("handle_cap_grant inode %p cap %p mds%d seq %d %s\n", | 2299 | dout("handle_cap_grant inode %p cap %p mds%d seq %u/%u %s\n", |
2299 | inode, cap, mds, seq, ceph_cap_string(newcaps)); | 2300 | inode, cap, mds, seq, issue_seq, ceph_cap_string(newcaps)); |
2300 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, | 2301 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, |
2301 | inode->i_size); | 2302 | inode->i_size); |
2302 | 2303 | ||
@@ -2392,6 +2393,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2392 | } | 2393 | } |
2393 | 2394 | ||
2394 | cap->seq = seq; | 2395 | cap->seq = seq; |
2396 | cap->issue_seq = issue_seq; | ||
2395 | 2397 | ||
2396 | /* file layout may have changed */ | 2398 | /* file layout may have changed */ |
2397 | ci->i_layout = grant->layout; | 2399 | ci->i_layout = grant->layout; |
@@ -2774,15 +2776,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
2774 | if (op == CEPH_CAP_OP_IMPORT) | 2776 | if (op == CEPH_CAP_OP_IMPORT) |
2775 | __queue_cap_release(session, vino.ino, cap_id, | 2777 | __queue_cap_release(session, vino.ino, cap_id, |
2776 | mseq, seq); | 2778 | mseq, seq); |
2777 | 2779 | goto flush_cap_releases; | |
2778 | /* | ||
2779 | * send any full release message to try to move things | ||
2780 | * along for the mds (who clearly thinks we still have this | ||
2781 | * cap). | ||
2782 | */ | ||
2783 | ceph_add_cap_releases(mdsc, session); | ||
2784 | ceph_send_cap_releases(mdsc, session); | ||
2785 | goto done; | ||
2786 | } | 2780 | } |
2787 | 2781 | ||
2788 | /* these will work even if we don't have a cap yet */ | 2782 | /* these will work even if we don't have a cap yet */ |
@@ -2810,7 +2804,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
2810 | dout(" no cap on %p ino %llx.%llx from mds%d\n", | 2804 | dout(" no cap on %p ino %llx.%llx from mds%d\n", |
2811 | inode, ceph_ino(inode), ceph_snap(inode), mds); | 2805 | inode, ceph_ino(inode), ceph_snap(inode), mds); |
2812 | spin_unlock(&inode->i_lock); | 2806 | spin_unlock(&inode->i_lock); |
2813 | goto done; | 2807 | goto flush_cap_releases; |
2814 | } | 2808 | } |
2815 | 2809 | ||
2816 | /* note that each of these drops i_lock for us */ | 2810 | /* note that each of these drops i_lock for us */ |
@@ -2834,6 +2828,17 @@ void ceph_handle_caps(struct ceph_mds_session *session, | |||
2834 | ceph_cap_op_name(op)); | 2828 | ceph_cap_op_name(op)); |
2835 | } | 2829 | } |
2836 | 2830 | ||
2831 | goto done; | ||
2832 | |||
2833 | flush_cap_releases: | ||
2834 | /* | ||
2835 | * send any full release message to try to move things | ||
2836 | * along for the mds (who clearly thinks we still have this | ||
2837 | * cap). | ||
2838 | */ | ||
2839 | ceph_add_cap_releases(mdsc, session); | ||
2840 | ceph_send_cap_releases(mdsc, session); | ||
2841 | |||
2837 | done: | 2842 | done: |
2838 | mutex_unlock(&session->s_mutex); | 2843 | mutex_unlock(&session->s_mutex); |
2839 | done_unlocked: | 2844 | done_unlocked: |