mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
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>
This commit is contained in:
parent
12a2f643b0
commit
3540303f87
@ -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) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user