linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-btrfs@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH] btrfs-progs: check: release path after usage
Date: Mon, 24 Oct 2016 10:18:14 -0500	[thread overview]
Message-ID: <20161024151814.15231-1-rgoldwyn@suse.de> (raw)

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

While performing an fsck, an assertion failure occurs because of reusing path in a loop.
ctree.c:1112: btrfs_search_slot: Warning: assertion `p->nodes[0] != NULL` failed, value 0

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

---

diff --git a/cmds-check.c b/cmds-check.c
index 670ccd1..5d9c724 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -7543,6 +7543,7 @@ static int record_orphan_data_extents(struct btrfs_fs_info *fs_info,
 		key.offset = dback->offset;
 
 		ret = btrfs_search_slot(NULL, dest_root, &key, path, 0, 0);
+		btrfs_release_path(path);
 		/*
 		 * For ret < 0, it's OK since the fs-tree may be corrupted,
 		 * we need to record it for inode/file extent rebuild.

             reply	other threads:[~2016-10-24 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 15:18 Goldwyn Rodrigues [this message]
2016-10-24 17:27 ` [PATCH] btrfs-progs: check: release path after usage David Sterba

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=20161024151814.15231-1-rgoldwyn@suse.de \
    --to=rgoldwyn@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.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 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).