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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Henry C Chang <henry.cy.chang@xxxxxxxxx>
---
 src/mds/Locker.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index 3c7c190..36da98e 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -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);
     }
   
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux