aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-11-02 22:32:37 -0400
committerSage Weil <sage@inktank.com>2012-11-04 06:08:24 -0500
commit4d1d0534f53863108fdea496288cb3310f88118d (patch)
tree121d1743f106900abb416d73c0bdc4c28bc94dcc /fs/ceph
parent9e15b77d9af3b63dfbff14e695336dfca88c22b2 (diff)
ceph: Hold caps_list_lock when adjusting caps_{use, total}_count
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 3251e9cc6401..2d0141e95c88 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -236,8 +236,10 @@ static struct ceph_cap *get_cap(struct ceph_mds_client *mdsc,
236 if (!ctx) { 236 if (!ctx) {
237 cap = kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS); 237 cap = kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS);
238 if (cap) { 238 if (cap) {
239 spin_lock(&mdsc->caps_list_lock);
239 mdsc->caps_use_count++; 240 mdsc->caps_use_count++;
240 mdsc->caps_total_count++; 241 mdsc->caps_total_count++;
242 spin_unlock(&mdsc->caps_list_lock);
241 } 243 }
242 return cap; 244 return cap;
243 } 245 }