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: v16.2.6~104^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a7ecce507a1ec9a04e520b163c384202cd7230ad;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 bef899246a21..b9b2b3cbd703 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -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;