From: Matt Benjamin Date: Sun, 7 Aug 2016 22:39:33 +0000 (-0400) Subject: rgw nfs: fix write continuations X-Git-Tag: v10.2.4~98^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88eeaa967494ba6b536d493d06bc4bdbe92e452f;p=ceph.git rgw nfs: fix write continuations Signed-off-by: Matt Benjamin (cherry picked from commit b4d079f2b5a4d49b2ba7576b272a2a3f3b0d66c8) --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 0bab892474d5..a99ea5067f0a 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -1926,8 +1926,7 @@ public: RGWPutObjProcessor *processor; buffer::list data; MD5 hash; - off_t last_off; - off_t next_off; + off_t real_ofs; size_t bytes_written; bool multipart; bool eio; @@ -1935,8 +1934,8 @@ public: RGWWriteRequest(CephContext* _cct, RGWUserInfo *_user, RGWFileHandle* _fh, const std::string& _bname, const std::string& _oname) : RGWLibContinuedReq(_cct, _user), bucket_name(_bname), obj_name(_oname), - rgw_fh(_fh), processor(nullptr), last_off(0), next_off(0), - bytes_written(0), multipart(false), eio(false) { + rgw_fh(_fh), processor(nullptr), real_ofs(0), bytes_written(0), + multipart(false), eio(false) { int ret = header_init(); if (ret == 0) { @@ -2009,10 +2008,12 @@ public: } void put_data(off_t off, buffer::list& _bl) { - if (off && (off != (ofs+1))) + if (off != real_ofs) { eio = true; - ofs = off; + } data.claim(_bl); + real_ofs += data.length(); + ofs = off; /* consumed in exec_continue() */ } virtual int exec_start();