From 7f7a9988ff2261c38398e11375570e78a9d87405 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 18 Mar 2014 14:54:26 -0700 Subject: [PATCH] mds/Locker: fix null deref on cap import The session Connection* may be NULL. Fixes: #7708 Signed-off-by: Sage Weil --- src/mds/Locker.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.47.3