From: Yan, Zheng Date: Sat, 3 Nov 2012 02:32:37 +0000 (+0800) Subject: ceph: Hold caps_list_lock when adjusting caps_{use, total}_count X-Git-Tag: v3.12-rc1~1650^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d1d0534f53863108fdea496288cb3310f88118d;p=kernel%2Fkernel-generic.git ceph: Hold caps_list_lock when adjusting caps_{use, total}_count Signed-off-by: Yan, Zheng Signed-off-by: Sage Weil --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 3251e9c..2d0141e 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; }