Commit 964266cc authored by Yan, Zheng's avatar Yan, Zheng Committed by Sage Weil

ceph: set mds_want according to cap import message

MDS ignores cap update message if migrate_seq mismatch, so when
receiving a cap import message with higher migrate_seq, set mds_want
according to the cap import message.
Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: default avatarGreg Farnum <greg@inktank.com>
parent d40ee0dc
...@@ -553,6 +553,7 @@ int ceph_add_cap(struct inode *inode, ...@@ -553,6 +553,7 @@ int ceph_add_cap(struct inode *inode,
cap->implemented = 0; cap->implemented = 0;
cap->mds = mds; cap->mds = mds;
cap->mds_wanted = 0; cap->mds_wanted = 0;
cap->mseq = 0;
cap->ci = ci; cap->ci = ci;
__insert_cap_node(ci, cap); __insert_cap_node(ci, cap);
...@@ -628,7 +629,10 @@ int ceph_add_cap(struct inode *inode, ...@@ -628,7 +629,10 @@ int ceph_add_cap(struct inode *inode,
cap->cap_id = cap_id; cap->cap_id = cap_id;
cap->issued = issued; cap->issued = issued;
cap->implemented |= issued; cap->implemented |= issued;
cap->mds_wanted |= wanted; if (mseq > cap->mseq)
cap->mds_wanted = wanted;
else
cap->mds_wanted |= wanted;
cap->seq = seq; cap->seq = seq;
cap->issue_seq = seq; cap->issue_seq = seq;
cap->mseq = mseq; cap->mseq = mseq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment