summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-11-03 03:32:37 +0100
committerSage Weil <sage@inktank.com>2012-11-04 12:08:24 +0100
commit4d1d0534f53863108fdea496288cb3310f88118d (patch)
tree121d1743f106900abb416d73c0bdc4c28bc94dcc /fs/ceph
parentrbd: get additional info in parent spec (diff)
downloadlinux-4d1d0534f53863108fdea496288cb3310f88118d.tar.xz
linux-4d1d0534f53863108fdea496288cb3310f88118d.zip
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,
if (!ctx) {
cap = kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS);
if (cap) {
+ spin_lock(&mdsc->caps_list_lock);
mdsc->caps_use_count++;
mdsc->caps_total_count++;
+ spin_unlock(&mdsc->caps_list_lock);
}
return cap;
}