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: v17.1.0~2020^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bfd83e8fa142873a0bdf09a4d1ad1b04127f5885;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 --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 50e0b6039614..d3047a326c8a 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;