Skip to contentSkip to conversation

ceph: Hold caps_list_lock when adjusting caps_{use,total}_count

PATCH New Yan, Zheng 1 participant 1 message Nov 3, 2012 Ceph client

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/1 ceph: Hold caps_list_lock when adjusting caps_{use,total}_count

From: "Yan, Zheng" <[email protected]>

---
 fs/ceph/caps.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ceph/caps.c +2 -0
index c633d1d..8072aef 100644
@@ -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;
 	}
Signature · 1 line
1.7.11.7