Re: [PATCH v2 1/4] pack-bitmap.c: check preferred pack validity when opening MIDX bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 24 2022, Taylor Blau wrote:

Just nits on the error reporting:

> @@ -353,6 +355,20 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
>  		warning(_("multi-pack bitmap is missing required reverse index"));
>  		goto cleanup;
>  	}
> +
> +	for (i = 0; i < bitmap_git->midx->num_packs; i++) {
> +		if (prepare_midx_pack(the_repository, bitmap_git->midx, i))
> +			die(_("could not open pack %s"),
> +			    bitmap_git->midx->pack_names[i]);

Some existing API users of this & their error handling suggest that this
message is wrong. I.e. it's not that we couldn't open it, but that we
could open it and there's something wrong with it. Or perhaps their
messages are misleading?

> +	}
> +
> +	preferred = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];
> +	if (!is_pack_valid(preferred)) {
> +		warning(_("preferred pack (%s) is invalid"),
> +			preferred->pack_name);

Likewise this? E.g. perhaps the permissions are just wrong or whatever,
per open_packed_git_1().



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux