diff options
-rw-r--r-- | fs/ceph/caps.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index d9e860ff9f3a..7d0a0d0adc18 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2836,11 +2836,18 @@ int ceph_encode_inode_release(void **p, struct inode *inode, | |||
2836 | struct ceph_cap *cap; | 2836 | struct ceph_cap *cap; |
2837 | struct ceph_mds_request_release *rel = *p; | 2837 | struct ceph_mds_request_release *rel = *p; |
2838 | int ret = 0; | 2838 | int ret = 0; |
2839 | 2839 | int used = 0; | |
2840 | dout("encode_inode_release %p mds%d drop %s unless %s\n", inode, | ||
2841 | mds, ceph_cap_string(drop), ceph_cap_string(unless)); | ||
2842 | 2840 | ||
2843 | spin_lock(&inode->i_lock); | 2841 | spin_lock(&inode->i_lock); |
2842 | used = __ceph_caps_used(ci); | ||
2843 | |||
2844 | dout("encode_inode_release %p mds%d used %s drop %s unless %s\n", inode, | ||
2845 | mds, ceph_cap_string(used), ceph_cap_string(drop), | ||
2846 | ceph_cap_string(unless)); | ||
2847 | |||
2848 | /* only drop unused caps */ | ||
2849 | drop &= ~used; | ||
2850 | |||
2844 | cap = __get_cap_for_mds(ci, mds); | 2851 | cap = __get_cap_for_mds(ci, mds); |
2845 | if (cap && __cap_is_valid(cap)) { | 2852 | if (cap && __cap_is_valid(cap)) { |
2846 | if (force || | 2853 | if (force || |