Skip to content

Commit

Permalink
ceph: set mds_want according to cap import message
Browse files Browse the repository at this point in the history
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: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
  • Loading branch information
Yan, Zheng authored and Sage Weil committed May 2, 2013
1 parent d40ee0d commit 964266c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ int ceph_add_cap(struct inode *inode,
cap->implemented = 0;
cap->mds = mds;
cap->mds_wanted = 0;
cap->mseq = 0;

cap->ci = ci;
__insert_cap_node(ci, cap);
Expand Down Expand Up @@ -628,7 +629,10 @@ int ceph_add_cap(struct inode *inode,
cap->cap_id = cap_id;
cap->issued = 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->issue_seq = seq;
cap->mseq = mseq;
Expand Down

0 comments on commit 964266c

Please sign in to comment.