Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 508794eb authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

Btrfs: don't panic if we get an error while balancing V2



A user reported an error where if we try to balance an fs after a device has
been removed it will blow up.  This is because we get an EIO back and this is
where BUG_ON(ret) bites us in the ass.  To fix we just exit.  Thanks,

Reported-by: default avatarAnand Jain <Anand.Jain@oracle.com>
Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 0942caa3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2098,7 +2098,8 @@ int btrfs_balance(struct btrfs_root *dev_root)
					   chunk_root->root_key.objectid,
					   found_key.objectid,
					   found_key.offset);
		BUG_ON(ret && ret != -ENOSPC);
		if (ret && ret != -ENOSPC)
			goto error;
		key.offset = found_key.offset - 1;
	}
	ret = 0;