On Sun, Jan 20, 2013 at 04:04:06PM -0500, Gene Czarcinski wrote:
> From: Nageswara R Sastry <nasas...@in.ibm.com>
> 
> Check for the return value of 'open_ctree()' before dereferencing it.
> 
> --- a/btrfs-image.c
> +++ b/btrfs-image.c
> @@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, 
> int num_threads,
>       int ret;
>  
>       root = open_ctree(input, 0, 0);
> +     BUG_ON(!root);

Bug_on is not the right fix here, I prefer a more extensive fix

http://permalink.gmane.org/gmane.comp.file-systems.btrfs/15305

which prints a message and exits.

>       BUG_ON(root->nodesize != root->leafsize);
>  
>       ret = metadump_init(&metadump, root, out, num_threads,
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to