From: luo rixin Date: Tue, 29 Dec 2020 06:39:21 +0000 (+0800) Subject: rgw/rgw_file: Fix the return value of read() and readlink() X-Git-Tag: v15.2.14~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41416%2Fhead;p=ceph.git rgw/rgw_file: Fix the return value of read() and readlink() Fixes: https://tracker.ceph.com/issues/49189 Signed-off-by: Dai zhiwei Signed-off-by: luo rixin (cherry picked from commit bfd83e8fa142873a0bdf09a4d1ad1b04127f5885) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index c204c1886f2c3..b78d0506ef840 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -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;