[PATCH 2/2] mds: Release resource before return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Close file before return.
Fix coverity issue: CID 1019571

Signed-off-by: Li Wang <liwang@xxxxxxxxxxxxxxx>
Reported-by: Xianxia Xiao <xianxiaxiao@xxxxxxxxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux