Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: chris.mason@oracle.com
Cc: linux-btrfs@vger.kernel.org
Subject: re: Btrfs: get/set for struct header fields
Date: Fri, 18 Mar 2016 08:37:45 +0300	[thread overview]
Message-ID: <20160318053745.GB2111@mwanda> (raw)

Hello Chris Mason,

The patch 7518a238ea01: "Btrfs: get/set for struct header fields"
from Mar 12, 2007, leads to the following static checker warning:

	fs/btrfs/print-tree.c:359 btrfs_print_tree()
	error: 'next' dereferencing possible ERR_PTR()

fs/btrfs/print-tree.c
   355          for (i = 0; i < nr; i++) {
   356                  struct extent_buffer *next = read_tree_block(root,
                                                     ^^^^^^^^^^^^^^^
This function can fail.  The original code was buggy as well before
7518a238ea01.

   357                                          btrfs_node_blockptr(c, i),
   358                                          btrfs_node_ptr_generation(c, i));
   359                  if (btrfs_is_leaf(next) &&
   360                     level != 1)
   361                          BUG();
   362                  if (btrfs_header_level(next) !=
   363                         level - 1)
   364                          BUG();
   365                  btrfs_print_tree(root, next);
   366                  free_extent_buffer(next);
   367          }


regards,
dan carpenter

                 reply	other threads:[~2016-03-18  5:37 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=20160318053745.GB2111@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=chris.mason@oracle.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