diff mbox

Btrfs-progs: bail if we find errors in the extent tree

Message ID 1389126861-31257-1-git-send-email-jbacik@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik Jan. 7, 2014, 8:34 p.m. UTC
For some reason we weren't exiting if there were errors in the extent tree,
which means we could have errors in just the extent tree and things like
xfstests would keep going because we completely throw away the return value.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 cmds-check.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Josef Bacik Jan. 7, 2014, 9:07 p.m. UTC | #1
On 01/07/2014 03:34 PM, Josef Bacik wrote:
> For some reason we weren't exiting if there were errors in the extent tree,
> which means we could have errors in just the extent tree and things like
> xfstests would keep going because we completely throw away the return value.
> Thanks,
>
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
>   cmds-check.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/cmds-check.c b/cmds-check.c
> index 689fe6c..cbabfdc 100644
> --- a/cmds-check.c
> +++ b/cmds-check.c
> @@ -6409,8 +6409,10 @@ int cmd_check(int argc, char **argv)
>   		goto out;
>   	}
>   	ret = check_chunks_and_extents(root);
> -	if (ret)
> +	if (ret) {
>   		fprintf(stderr, "Errors found in extent allocation tree or chunk allocation\n");
> +		goto out;
> +	}
>   
>   	fprintf(stderr, "checking free space cache\n");
>   	ret = check_space_cache(root);
Sigh ignore this, it is causing other problems, I'm going to have to 
figure out a better solution to this.  Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-check.c b/cmds-check.c
index 689fe6c..cbabfdc 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6409,8 +6409,10 @@  int cmd_check(int argc, char **argv)
 		goto out;
 	}
 	ret = check_chunks_and_extents(root);
-	if (ret)
+	if (ret) {
 		fprintf(stderr, "Errors found in extent allocation tree or chunk allocation\n");
+		goto out;
+	}
 
 	fprintf(stderr, "checking free space cache\n");
 	ret = check_space_cache(root);