mds: issue caps on file update finish if no client cap specified
PATCH 1/1 mds: issue caps on file update finish if no client cap specified
Fix the following scenario that happens occasionally when running blogbench:
client released caps on one inode. Then, the inode's ifile was wrlocked during updating client range. Before the update had finished, client re-opened the file again for reading. Since ifile was wrlocked, the client was not given the Fr cap and was blocked on reading forever.
--- src/mds/Locker.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
src/mds/Locker.cc +1 -1
@@ -1242,7 +1242,7 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, client_t if (gather) eval_cap_gather(in); } else { - if (cap && (cap->wanted() & ~cap->pending())) { + if (!cap || (cap && (cap->wanted() & ~cap->pending()))) { issue_caps(in, cap); }
Signature · 1 line
1.7.4.1
Quoted 7 lines · Henry C Chang
Fix the following scenario that happens occasionally when running blogbench:
client released caps on one inode. Then, the inode's ifile was wrlocked during updating client range. Before the update had finished, client re-opened the file again for reading. Since ifile was wrlocked, the client was not given the Fr cap and was blocked on reading forever.
This one I'm not sure about. Do you have an MDS log for this case? I would expect the cap issue to happen when we drop_locks(mut) and the lock state changes.
sage
Quoted 28 lines
Signed-off-by Henry C Chang <[email protected]>--- src/mds/Locker.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)src/mds/Locker.cc +1
-1@@ -1242,7 +1242,7 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, client_t if (gather) eval_cap_gather(in); } else { - if (cap && (cap->wanted() & ~cap->pending())) { + if (!cap || (cap && (cap->wanted() & ~cap->pending()))) { issue_caps(in, cap); }Signature · 6 lines
1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines
This one I'm not sure about. Do you have an MDS log for this case? I would expect the cap issue to happen when we
drop_locks(mut)and the lock state changes.
OK. I'll try to reproduce it with debug log on.
Henry
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I created a ticket - http://tracker.newdream.net/issues/1084 and uploaded the mds log where I found the problem.
(Full log is huge. I just uploaded the critical part. Let me know if you need the full one.)
Henry
2011/5/12 Henry C Chang <[email protected]>:
Quoted 9 lines
Quoted 4 lines
This one I'm not sure about. Do you have an MDS log for this case? I would expect the cap issue to happen when we
drop_locks(mut)and the lock state changes.OK. I'll try to reproduce it with debug log on.
Henry
Signature · 5 lines
Henry Chang -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html