]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_file: Fix the return value of read() and readlink() 38729/head
authorluo rixin <luorixin@huawei.com>
Tue, 29 Dec 2020 06:39:21 +0000 (14:39 +0800)
committerluo rixin <luorixin@huawei.com>
Sat, 20 Feb 2021 07:29:26 +0000 (15:29 +0800)
Fixes: https://tracker.ceph.com/issues/49189
Signed-off-by: Dai zhiwei <daizhiwei3@huawei.com>
Signed-off-by: luo rixin <luorixin@huawei.com>
src/rgw/rgw_file.cc

index 50e0b6039614c38d79400d59f191a05d97573376..d3047a326c8a4dcf04a1f1bbc7d01c53b431d46c 100644 (file)
@@ -324,7 +324,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;
@@ -347,7 +347,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;