]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_file: Fix the return value of read() and readlink() 42654/head
authorluo rixin <luorixin@huawei.com>
Tue, 29 Dec 2020 06:39:21 +0000 (14:39 +0800)
committerCory Snyder <csnyder@iland.com>
Wed, 4 Aug 2021 16:12:20 +0000 (12:12 -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 bef899246a2197ec5869eee2fb415e9ee82271a0..b9b2b3cbd703471fe5d20577a3f8a376137a8d1b 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;