]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore:cleanup the judgment for write_fd() returned 10146/head
authoryonghengdexin735 <zhang.zezhu@zte.com.cn>
Wed, 8 Mar 2017 08:40:37 +0000 (16:40 +0800)
committeryonghengdexin735 <zhang.zezhu@zte.com.cn>
Wed, 29 Mar 2017 09:30:16 +0000 (17:30 +0800)
Signed-off-by: yonghengdexin735 <zhang.zezhu@zte.com.cn>
src/os/filestore/FileStore.cc

index 40fe2f99bea938eb861df616e94b0460b27db225..98c0624bcbc4e5658e8b3275be9262b9d2c8bd6f 100644 (file)
@@ -3392,8 +3392,13 @@ int FileStore::_write(const coll_t& cid, const ghobject_t& oid,
 
   // write
   r = bl.write_fd(**fd, offset);
-  if (r == 0)
-    r = bl.length();
+  if (r < 0) {
+    derr << __func__ << " write_fd on " << cid << "/" << oid
+         << " error: " << cpp_strerror(r) << dendl;
+    lfn_close(fd);
+    goto out;
+  }
+  r = bl.length();
 
   if (r >= 0 && m_filestore_sloppy_crc) {
     int rc = backend->_crc_update_write(**fd, offset, len, bl);