summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-05-12 15:13:23 -0700
committerSage Weil <sage@newdream.net>2011-05-19 11:25:03 -0700
commit3540303f87115cbdae6ed2cab44ce6a7676d48d3 (patch)
treeeb1003ac91370488972e3e5b126771707cf98a88 /fs/ceph
parent12a2f643b0e6e791ba61485430d0003eeb3e373c (diff)
downloadop-kernel-dev-3540303f87115cbdae6ed2cab44ce6a7676d48d3.zip
op-kernel-dev-3540303f87115cbdae6ed2cab44ce6a7676d48d3.tar.gz
ceph: fix rare potential cap leak
If we grab new_cap, retake the lock, and find we already have a cap now for the given mds, release new_cap. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 2a5404c..591202b 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -569,7 +569,8 @@ retry:
list_add_tail(&cap->session_caps, &session->s_caps);
session->s_nr_caps++;
spin_unlock(&session->s_cap_lock);
- }
+ } else if (new_cap)
+ ceph_put_cap(mdsc, new_cap);
if (!ci->i_snap_realm) {
/*
OpenPOWER on IntegriCloud