From: Sage Weil Date: Tue, 18 Mar 2014 21:54:26 +0000 (-0700) Subject: mds/Locker: fix null deref on cap import X-Git-Tag: v0.79~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1496%2Fhead;p=ceph.git mds/Locker: fix null deref on cap import The session Connection* may be NULL. Fixes: #7708 Signed-off-by: Sage Weil --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 1906c49bc4c1..e69e985accbc 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1799,8 +1799,10 @@ bool Locker::issue_caps(CInode *in, Capability *only_cap) // add in any xlocker-only caps (for locks this client is the xlocker for) allowed |= xlocker_allowed & in->get_xlocker_mask(it->first); + Session *session = mds->get_session(it->first); if (in->inode.inline_version != CEPH_INLINE_NONE && - !mds->get_session(it->first)->connection->has_feature(CEPH_FEATURE_MDS_INLINE_DATA)) + !(session && session->connection && + session->connection->has_feature(CEPH_FEATURE_MDS_INLINE_DATA))) allowed &= ~(CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR); int pending = cap->pending();