From 9dcf5e086de25cc5f231f6be7a4f46723982d981 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 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; -- 2.47.3