]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw nfs: fix write continuations 10611/head
authorMatt Benjamin <mbenjamin@redhat.com>
Sun, 7 Aug 2016 22:39:33 +0000 (18:39 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 8 Aug 2016 15:11:51 +0000 (11:11 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.h

index cf2897c6eecdbd8de64d8363c0520742a2769d05..b9718c167f4ac851ef94620607023abf55e32416 100644 (file)
@@ -1935,8 +1935,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;
@@ -1944,8 +1943,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) {
@@ -2018,10 +2017,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();