]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: do not gratuitously drop FILE_CACHE ref in _read()
authorSage Weil <sage@inktank.com>
Fri, 9 Nov 2012 14:48:10 +0000 (06:48 -0800)
committerSage Weil <sage@inktank.com>
Fri, 9 Nov 2012 15:38:42 +0000 (07:38 -0800)
The get_caps() had a confusing out-arg called "got" that is really what
caps we *have*; it only takes a ref on the *need* cap.  We should only
put that one explicitly (CEPH_CAP_FILE_RD).  The _write() method already
does this properly, but _read() did not.

Fixes: #3470
Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc

index 08841d129cfc971cf51738918a362c3f3ae2c187..f58640090aabbedfe1c26fee5f198e60b7eea340 100644 (file)
@@ -5177,7 +5177,7 @@ int Client::_read(Fh *f, int64_t offset, uint64_t size, bufferlist *bl)
   f->last_pos = offset+bl->length();
 
   // done!
-  put_cap_ref(in, got);
+  put_cap_ref(in, CEPH_CAP_FILE_RD);
   return r;
 }