From a7ecce507a1ec9a04e520b163c384202cd7230ad Mon Sep 17 00:00:00 2001 From: luo rixin Date: Tue, 29 Dec 2020 14:39:21 +0800 Subject: [PATCH] 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) --- src/rgw/rgw_file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index bef899246a219..b9b2b3cbd7034 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; -- 2.39.5