]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix fuse client can't read or write data due its caps is invalid 25091/head
authorYunfeiGuan <yunfeiguan@xtaotech.com>
Wed, 26 Sep 2018 09:01:38 +0000 (17:01 +0800)
committerJonathan Brielmaier <jbrielmaier@suse.de>
Wed, 14 Nov 2018 12:53:09 +0000 (13:53 +0100)
We can't do read or write if we don't have Fr or Fw.Similarly, if the
caps is invalid, we can't read or wirte either.

What's worse,the mds don't konw our cap gen is invalid and think client
inode's caps is right.Thus will lead client application hung all the time.

Fixes: http://tracker.ceph.com/issues/36189
Signed-off-by: Guan yunfei <yunfei.guan@xtaotech.com>
(cherry picked from commit 1d742aa51be07cebf1b0d19b6640684b263e6bfc)
Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
src/client/Client.cc

index 166b5f18b10ef64fb9886ffead1c9260eb0f9d72..0713caedf01052294db0b86296e783bded806b69 100644 (file)
@@ -2770,7 +2770,8 @@ void Client::send_reconnect(MetaSession *session)
       cap.issue_seq = 0;  // reset seq.
       cap.mseq = 0;  // reset seq.
       cap.issued = cap.implemented;
-
+      // cap gen should catch up with session cap_gen
+      cap.gen = cap.session->cap_gen;
       snapid_t snap_follows = 0;
       if (!in->cap_snaps.empty())
        snap_follows = in->cap_snaps.begin()->first;