Skip to content

Commit

Permalink
rgw nfs: fix write continuations
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Benjamin <[email protected]>
  • Loading branch information
mattbenjamin committed Aug 8, 2016
1 parent d74d461 commit b4d079f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/rgw/rgw_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -1935,17 +1935,16 @@ class RGWWriteRequest : public RGWLibContinuedReq,
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;

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) {
Expand Down Expand Up @@ -2018,10 +2017,12 @@ class RGWWriteRequest : public RGWLibContinuedReq,
}

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();
Expand Down

0 comments on commit b4d079f

Please sign in to comment.