linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Landden <shawnlandden@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Shawn Landden <shawnlandden@gmail.com>
Subject: [PATCH] Check for failure in open_ctree() call. (LP: #926186)
Date: Mon,  2 Jul 2012 17:25:26 -0700	[thread overview]
Message-ID: <1341275126-17671-1-git-send-email-shawnlandden@gmail.com> (raw)

---
 btrfstune.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/btrfstune.c b/btrfstune.c
index 47830c5..f746e14 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -107,6 +107,10 @@ int main(int argc, char *argv[])
 	}
 
 	root = open_ctree(device, 0, 1);
+	if (!root) {
+		fprintf(stderr, "unable to open ctree\n");
+		return 1;
+        }
 
 	if (seeding_flag) {
 		ret = update_seeding_flag(root, seeding_value);
-- 
1.7.9.5


                 reply	other threads:[~2012-07-03  0:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1341275126-17671-1-git-send-email-shawnlandden@gmail.com \
    --to=shawnlandden@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).