[10/10] btrfs-progs: check: Fix wrong error message in case of corrupted bitmap
diff mbox series

Message ID 1538405181-25231-11-git-send-email-nborisov@suse.com
State New
Headers show
Series
  • Freespace tree repair support v2
Related show

Commit Message

Nikolay Borisov Oct. 1, 2018, 2:46 p.m. UTC
Similarly to the fix in e444c7bfa65f ("btrfs-progs: check: Fix wrong
error message in case of corrupted extent") this commits addresses the
same problem but for corrupted bitmap objects.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 free-space-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Omar Sandoval Oct. 4, 2018, 7:18 p.m. UTC | #1
On Mon, Oct 01, 2018 at 05:46:21PM +0300, Nikolay Borisov wrote:
> Similarly to the fix in e444c7bfa65f ("btrfs-progs: check: Fix wrong
> error message in case of corrupted extent") this commits addresses the
> same problem but for corrupted bitmap objects.

Oops.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  free-space-tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/free-space-tree.c b/free-space-tree.c
> index 3b7e8a3fe4f5..690da44a739d 100644
> --- a/free-space-tree.c
> +++ b/free-space-tree.c
> @@ -1302,7 +1302,7 @@ static int load_free_space_bitmaps(struct btrfs_fs_info *fs_info,
>  		if (key.objectid + key.offset > end) {
>  			fprintf(stderr,
>  	"free space bitmap ends at %llu, beyond end of block group %llu-%llu\n",
> -				key.objectid, start, end);
> +				key.objectid + key.offset, start, end);
>  			(*errors)++;
>  			break;
>  		}
> -- 
> 2.7.4
>

Patch
diff mbox series

diff --git a/free-space-tree.c b/free-space-tree.c
index 3b7e8a3fe4f5..690da44a739d 100644
--- a/free-space-tree.c
+++ b/free-space-tree.c
@@ -1302,7 +1302,7 @@  static int load_free_space_bitmaps(struct btrfs_fs_info *fs_info,
 		if (key.objectid + key.offset > end) {
 			fprintf(stderr,
 	"free space bitmap ends at %llu, beyond end of block group %llu-%llu\n",
-				key.objectid, start, end);
+				key.objectid + key.offset, start, end);
 			(*errors)++;
 			break;
 		}