xfs
[Top] [All Lists]

Re: [PATCH 13/11] xfsprogs: Add a way to compile without blkid

To: Jan Tulak <jtulak@xxxxxxxxxx>
Subject: Re: [PATCH 13/11] xfsprogs: Add a way to compile without blkid
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 14 Aug 2015 10:54:30 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1439475055-5519-1-git-send-email-jtulak@xxxxxxxxxx>
References: <1439475055-5519-1-git-send-email-jtulak@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Aug 13, 2015 at 04:10:55PM +0200, Jan Tulak wrote:
> Because not all platforms have up-to-date blkid with required
> functions, allow at least partial functionality by adding
> --enable-blkid=yes/no optional configure argument.
> 
> When blkid is disabled, signature detection and device geometry
> detection doesn't work.
> 
> Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>

.....
> +#else /* ifdef ENABLE_BLKID */
> +/*
> + * Without blkid, we can't do a good check for signatures.
> + * So instead of some messy attempts, just disable any checks
> + * and always return 'nothing found'.
> + */
> +static int
> +check_overwrite(
> +     char            *device)
> +{
> +     return 0;
> +}
> +#endif /* ENABLE_BLKID */

I'd default the other way around, and always report that something
was found. That way we don't accidentally overwrite a block device
when someone fat-fingers the blockdev. It will mean you have to use
the force flag on OSX until such time that blkid is made to work,
but I think that's better than just overwriting the blockdev without
question....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>