summaryrefslogtreecommitdiff
path: root/src/client/MetaSession.h
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-10-20 17:08:42 +0800
committerYan, Zheng <zheng.z.yan@intel.com>2013-10-20 17:27:49 +0800
commit6ed3ada9e6e34ffc407e0f5f1ffeada9e50a8cf9 (patch)
tree2c036585e584b688038023b2de4bc338054288ee /src/client/MetaSession.h
parent4d3502ba9b310cddcd8325da4b08adee26587143 (diff)
downloadceph-wip-6599.tar.gz
client: fix invalid iterator dereference in Client::trim_caps()wip-6599
trimming inode drops a reference to the inode's parent, it may cause the inode's parent also be trimmed. If the cap iterator 'p' happens to point to the inode's parent and the inode's parent is trimmed, the cap iterator 'p' become invalid. Fix the issue by delaying removing cap from the seesion cap list. (similar to what the kclient does) Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'src/client/MetaSession.h')
-rw-r--r--src/client/MetaSession.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/MetaSession.h b/src/client/MetaSession.h
index a6cf634c969..d9fcbb881d9 100644
--- a/src/client/MetaSession.h
+++ b/src/client/MetaSession.h
@@ -43,12 +43,14 @@ struct MetaSession {
xlist<MetaRequest*> requests;
xlist<MetaRequest*> unsafe_requests;
+ Cap *s_cap_iterator;
+
MClientCapRelease *release;
MetaSession()
: mds_num(-1), con(NULL),
seq(0), cap_gen(0), cap_renew_seq(0), num_caps(0),
- state(STATE_NEW),
+ state(STATE_NEW), s_cap_iterator(NULL),
release(NULL)
{}
~MetaSession();