Btrfs-progs: fix segmentation fault of "btrfs check"

Segmentation fault occurred in the following command.

 # btrfs check /dev/sdc7
 No valid Btrfs found on /dev/sdc7
 Segmentation fault (core dumped)

Fix it.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
master
Tsutomu Itoh 2013-02-27 11:31:54 +09:00 committed by David Sterba
parent e929e2947a
commit b7b27b4efb
1 changed files with 3 additions and 3 deletions

View File

@ -3610,12 +3610,12 @@ int cmd_check(int argc, char **argv)
}
info = open_ctree_fs_info(argv[optind], bytenr, rw, 1);
uuid_unparse(info->super_copy.fsid, uuidbuf);
printf("Checking filesystem on %s\nUUID: %s\n", argv[optind], uuidbuf);
if (info == NULL)
return 1;
uuid_unparse(info->super_copy.fsid, uuidbuf);
printf("Checking filesystem on %s\nUUID: %s\n", argv[optind], uuidbuf);
if (!extent_buffer_uptodate(info->tree_root->node) ||
!extent_buffer_uptodate(info->dev_root->node) ||
!extent_buffer_uptodate(info->extent_root->node) ||