From 768c47d24f1a2fb2a39f4a2cdc535b42a53a61f5 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 3 Sep 2013 13:27:21 -0700 Subject: rgw: when failing read from client, return correct error Fixes: #6214 Backport: bobtail, cuttlefish, dumpling When getting a failed read from client when putting an object we returned the wrong value (always 0), which in the chunked- upload case ended up in assuming that the write was done successfully. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 571e4869642..c4d6a287cc5 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -691,7 +691,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl) int r = s->cio->read(bp.c_str(), cl, &read_len); len = read_len; if (r < 0) - return ret; + return r; bl.append(bp, 0, len); } -- cgit v1.2.1