From: yonghengdexin735 Date: Wed, 8 Mar 2017 08:40:37 +0000 (+0800) Subject: os/filestore:cleanup the judgment for write_fd() returned X-Git-Tag: v12.0.2~181^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d7f64f9f9c5e5ebe454e9450e36281bc27efeb1c;p=ceph.git os/filestore:cleanup the judgment for write_fd() returned Signed-off-by: yonghengdexin735 --- diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 40fe2f99bea9..98c0624bcbc4 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -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);