]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_file: Fix the return value of read() and readlink() 41416/head
authorluo rixin <luorixin@huawei.com>
Tue, 29 Dec 2020 06:39:21 +0000 (14:39 +0800)
committerCory Snyder <csnyder@iland.com>
Wed, 19 May 2021 17:27:57 +0000 (13:27 -0400)
Fixes: https://tracker.ceph.com/issues/49189
Signed-off-by: Dai zhiwei <daizhiwei3@huawei.com>
Signed-off-by: luo rixin <luorixin@huawei.com>
(cherry picked from commit bfd83e8fa142873a0bdf09a4d1ad1b04127f5885)

src/rgw/rgw_file.cc

index c204c1886f2c37393bdb374fb16eb92387285f71..b78d0506ef840745f50233e4fb34ae5736efa789 100644 (file)
@@ -298,7 +298,7 @@ namespace rgw {
 
     int rc = rgwlib.get_fe()->execute_req(&req);
     if ((rc == 0) &&
-       (req.get_ret() == 0)) {
+        ((rc = req.get_ret()) == 0)) {
       lock_guard guard(rgw_fh->mtx);
       rgw_fh->set_atime(real_clock::to_timespec(real_clock::now()));
       *bytes_read = req.nread;
@@ -322,7 +322,7 @@ namespace rgw {
 
     int rc = rgwlib.get_fe()->execute_req(&req);
     if ((rc == 0) &&
-        (req.get_ret() == 0)) {
+        ((rc = req.get_ret()) == 0)) {
       lock_guard(rgw_fh->mtx);
       rgw_fh->set_atime(real_clock::to_timespec(real_clock::now()));
       *bytes_read = req.nread;