]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: check sync write error
authorYan, Zheng <zyan@redhat.com>
Mon, 8 Apr 2019 03:28:32 +0000 (11:28 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 7 Jul 2020 15:25:41 +0000 (17:25 +0200)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 2cf6184e41f8364f79fb3adda737f21c9ee149f6)

src/client/Client.cc

index 7eb574634fe8f5d60789b4dc40c9224762d41ccf..c0f43e0f135dd8e36e238973ab31ed12d6d26bbe 100644 (file)
@@ -9755,9 +9755,11 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
                       in->truncate_size, in->truncate_seq,
                       &onfinish);
     client_lock.unlock();
-    onfinish.wait();
+    r = onfinish.wait();
     client_lock.lock();
     _sync_write_commit(in);
+    if (r < 0)
+      goto done;
   }
 
   // if we get here, write was successful, update client metadata