]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fixup warning 21088/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 28 Mar 2018 07:50:44 +0000 (15:50 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 28 Mar 2018 07:50:44 +0000 (15:50 +0800)
/src/client/Client.cc:8750:11: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
int64_t r;

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/client/Client.cc

index 281f9d33548a9a63b04698a32a611a9fe03224a6..50f3c2ce5ee24092a4f59f3853bc6d81e1999190 100644 (file)
@@ -8747,7 +8747,7 @@ int64_t Client::_read(Fh *f, int64_t offset, uint64_t size, bufferlist *bl)
   int have = 0;
   bool movepos = false;
   std::unique_ptr<C_SaferCond> onuninline;
-  int64_t r;
+  int64_t r = 0;
   const md_config_t *conf = cct->_conf;
   Inode *in = f->inode.get();
 
@@ -8763,7 +8763,7 @@ int64_t Client::_read(Fh *f, int64_t offset, uint64_t size, bufferlist *bl)
   loff_t start_pos = offset;
 
   if (in->inline_version == 0) {
-    int r = _getattr(in, CEPH_STAT_CAP_INLINE_DATA, f->actor_perms, true);
+    r = _getattr(in, CEPH_STAT_CAP_INLINE_DATA, f->actor_perms, true);
     if (r < 0) {
       goto done;
     }