All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@ubuntukylin.com>
To: ceph-devel@vger.kernel.org
Cc: Sage Weil <sage@inktank.com>, Li Wang <liwang@ubuntukylin.com>
Subject: [PATCH 2/2] mds: Release resource before return
Date: Mon, 18 Nov 2013 15:40:19 +0800	[thread overview]
Message-ID: <29600d7aede767b7f10879bd858ec1003cadc477.1384760071.git.liwang@ubuntukylin.com> (raw)
In-Reply-To: <cover.1384760071.git.liwang@ubuntukylin.com>
In-Reply-To: <cover.1384760071.git.liwang@ubuntukylin.com>

Close file before return.
Fix coverity issue: CID 1019571

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reported-by: Xianxia Xiao <xianxiaxiao@ubuntukylin.com>
---
 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


  parent reply	other threads:[~2013-11-18  7:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18  7:40 [PATCH 0/2] Fix resource leak Li Wang
2013-11-18  7:40 ` [PATCH 1/2] rbd: Release resource before return Li Wang
2013-11-18  7:40 ` Li Wang [this message]
2013-11-25 22:02 ` [PATCH 0/2] Fix resource leak Josh Durgin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29600d7aede767b7f10879bd858ec1003cadc477.1384760071.git.liwang@ubuntukylin.com \
    --to=liwang@ubuntukylin.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.