diff options
author | Sage Weil <sage@newdream.net> | 2010-09-22 14:16:00 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-10-07 11:01:50 -0400 |
commit | d91f2438d881514e4a923fd786dbd94b764a9440 (patch) | |
tree | d0419a4c2132687c58e54a18938ab2359794700d /fs/ceph | |
parent | 21b559de56695d36b3f0819b7e2454737db254f8 (diff) |
ceph: update issue_seq on cap grant
We need to update the issue_seq on any grant operation, be it via an MDS
reply or a separate grant message. The update in the grant path was
missing. This broke cap release for inodes in which the MDS sent an
explicit grant message that was not soon after followed by a successful
MDS reply on the same inode.
Also fix the signedness on seq locals.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 97de325a49f8..5e9da996a151 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2283,7 +2283,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2283 | { | 2283 | { |
2284 | struct ceph_inode_info *ci = ceph_inode(inode); | 2284 | struct ceph_inode_info *ci = ceph_inode(inode); |
2285 | int mds = session->s_mds; | 2285 | int mds = session->s_mds; |
2286 | int seq = le32_to_cpu(grant->seq); | 2286 | unsigned seq = le32_to_cpu(grant->seq); |
2287 | unsigned issue_seq = le32_to_cpu(grant->issue_seq); | ||
2287 | int newcaps = le32_to_cpu(grant->caps); | 2288 | int newcaps = le32_to_cpu(grant->caps); |
2288 | int issued, implemented, used, wanted, dirty; | 2289 | int issued, implemented, used, wanted, dirty; |
2289 | u64 size = le64_to_cpu(grant->size); | 2290 | u64 size = le64_to_cpu(grant->size); |
@@ -2295,8 +2296,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2295 | int revoked_rdcache = 0; | 2296 | int revoked_rdcache = 0; |
2296 | int queue_invalidate = 0; | 2297 | int queue_invalidate = 0; |
2297 | 2298 | ||
2298 | dout("handle_cap_grant inode %p cap %p mds%d seq %d %s\n", | 2299 | dout("handle_cap_grant inode %p cap %p mds%d seq %u/%u %s\n", |
2299 | inode, cap, mds, seq, ceph_cap_string(newcaps)); | 2300 | inode, cap, mds, seq, issue_seq, ceph_cap_string(newcaps)); |
2300 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, | 2301 | dout(" size %llu max_size %llu, i_size %llu\n", size, max_size, |
2301 | inode->i_size); | 2302 | inode->i_size); |
2302 | 2303 | ||
@@ -2392,6 +2393,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2392 | } | 2393 | } |
2393 | 2394 | ||
2394 | cap->seq = seq; | 2395 | cap->seq = seq; |
2396 | cap->issue_seq = issue_seq; | ||
2395 | 2397 | ||
2396 | /* file layout may have changed */ | 2398 | /* file layout may have changed */ |
2397 | ci->i_layout = grant->layout; | 2399 | ci->i_layout = grant->layout; |