diff options
-rw-r--r-- | fs/ceph/caps.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 619b61655ee5..d4fcdda7676c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2886,18 +2886,19 @@ int ceph_encode_inode_release(void **p, struct inode *inode, | |||
2886 | struct ceph_inode_info *ci = ceph_inode(inode); | 2886 | struct ceph_inode_info *ci = ceph_inode(inode); |
2887 | struct ceph_cap *cap; | 2887 | struct ceph_cap *cap; |
2888 | struct ceph_mds_request_release *rel = *p; | 2888 | struct ceph_mds_request_release *rel = *p; |
2889 | int used, dirty; | ||
2889 | int ret = 0; | 2890 | int ret = 0; |
2890 | int used = 0; | ||
2891 | 2891 | ||
2892 | spin_lock(&inode->i_lock); | 2892 | spin_lock(&inode->i_lock); |
2893 | used = __ceph_caps_used(ci); | 2893 | used = __ceph_caps_used(ci); |
2894 | dirty = __ceph_caps_dirty(ci); | ||
2894 | 2895 | ||
2895 | dout("encode_inode_release %p mds%d used %s drop %s unless %s\n", inode, | 2896 | dout("encode_inode_release %p mds%d used|dirty %s drop %s unless %s\n", |
2896 | mds, ceph_cap_string(used), ceph_cap_string(drop), | 2897 | inode, mds, ceph_cap_string(used|dirty), ceph_cap_string(drop), |
2897 | ceph_cap_string(unless)); | 2898 | ceph_cap_string(unless)); |
2898 | 2899 | ||
2899 | /* only drop unused caps */ | 2900 | /* only drop unused, clean caps */ |
2900 | drop &= ~used; | 2901 | drop &= ~(used | dirty); |
2901 | 2902 | ||
2902 | cap = __get_cap_for_mds(ci, mds); | 2903 | cap = __get_cap_for_mds(ci, mds); |
2903 | if (cap && __cap_is_valid(cap)) { | 2904 | if (cap && __cap_is_valid(cap)) { |