Re: [PATCH 1/2] blkid: stop scanning on I/O error

Karel Zak
2014-03-20T11:29:59Z

On Thu, Mar 20, 2014 at 11:03:49AM +0100, Hannes Reinecke wrote:
> +/**
> + * blkid_probe_get_idmag:
> + * @pr: probe
> + * @id: id information
> + * @offset: begin of probing area
> + * @res: found id information
> + *
> + * Check for matching magic value.
> + * Returns BLKID_PROBE_OK if found, BLKID_PROBE_NONE if not found
> + * or no magic present, or negative value on error.
> + */
> int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
> blkid_loff_t *offset, const struct blkid_idmag **res)
> {
> @@ -794,6 +812,8 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
> off = (mag->kboff + (mag->sboff >> 10)) << 10;
> buf = blkid_probe_get_buffer(pr, off, 1024);
>
> + if (!buf && errno)
> + return errno;

return -errno;

Otherwise it looks good.

Karel

--
Karel Zak <kzak@redhat.com>