re: Btrfs: get/set for struct header fields

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux