Re: [PATCH] mkfs: fix blkid probe API violations causing weird output

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

 



On Tue, Apr 15, 2025 at 09:35:46PM -0700, Christoph Hellwig wrote:
> On Tue, Apr 15, 2025 at 06:28:37PM -0700, Darrick J. Wong wrote:
> > +	/* libblkid 2.38.1 lies and can return -EIO */
> 
> Can you expand this comment be less terse using the wording in the
> commit message?  Otherwise looks good:

Ok.

> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> 
> Did you also report the bug to util-linux so that it gets fixed there?

I'm not even sure how to categorize it -- the API docs all say things
like this:

 * Returns: 0 on success, 1 if nothing is detected or -1 on case of error.
 */
int blkid_do_fullprobe(blkid_probe pr)

But then you look at the probe functions that it calls:

static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag)
{
	struct xfs_super_block *xs;

	xs = blkid_probe_get_sb(pr, mag, struct xfs_super_block);
	if (!xs)
		return errno ? -errno : 1;

or:

static int probe_apfs(blkid_probe pr, const struct blkid_idmag *mag)
{
	struct apfs_super_block *sb;

	sb = blkid_probe_get_sb(pr, mag, struct apfs_super_block);
	if (!sb)
		return errno ? -errno : BLKID_PROBE_NONE;

So I guess it's just ... super broken?

--D




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux