Skip to contentSkip to conversation

mds: issue caps on file update finish if no client cap specified

PATCH In review Henry C Chang 2 participants 4 messages May 11, 2011 – May 12, 2011

lore
Share & tools
lore
#0 lore raw

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
index 3c7c190..36da98e 100644
@@ -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
#1 lore raw
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
---
 src/mds/Locker.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/mds/Locker.cc +1 -1
index 3c7c190..36da98e 100644
@@ -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
#2 lore raw
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

#3 lore raw

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