Close file before return.
Fix coverity issue: CID 1019571

Signed-off-by: Li Wang <[email protected]>
Reported-by: Xianxia Xiao <[email protected]>
---
 src/mds/MDCache.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index ae59c26..17d4ce4 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -11731,7 +11731,7 @@ void MDCache::dump_cache(const char *fn)
     std::string s = ss.str();
     r = safe_write(fd, s.c_str(), s.length());
     if (r < 0)
-      return;
+      goto out;
 
     list<CDir*> dfs;
     in->get_dirfrags(dfs);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to