]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client/Inode.cc: cap_is_valid() fix return value
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 9 Jun 2015 12:26:05 +0000 (14:26 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 17 Jul 2015 08:50:08 +0000 (10:50 +0200)
Inode::cap_is_valid() never returns false in case the
evaluation fails.

Fix for:

CID 1297828 (#1 of 1): Identical code for different branches (IDENTICAL_BRANCHES)
 identical_branches: The same code is executed when the condition
  cap->session->cap_gen <= cap->gen && ceph_clock_now(this->cct) <
  cap->session->cap_ttl is true or false, because the code in the
  if-then branch and after the if statement is identical. Should
  the if statement be removed?
 implicit_else: The code from the above if-then branch is identical
  to the code after the if statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/client/Inode.cc

index c63ba1c9e370b9314a75f6b7400a99c104b57981..69a8baa3eacfbd518ac5c9501c9ec819b07a7d3d 100644 (file)
@@ -154,7 +154,7 @@ bool Inode::cap_is_valid(Cap* cap)
       && (ceph_clock_now(cct) < cap->session->cap_ttl)) {
     return true;
   }
-  return true;
+  return false;
 }
 
 int Inode::caps_issued(int *implemented)