[PATCH] mkfs: fix mkfs when blkid fails
Alex Elder
aelder at sgi.com
Thu Jan 14 15:06:15 CST 2010
Eric Sandeen wrote:
> When trying to mkfs something that blkid doesn't grok:
>
> # mkfs.xfs fsfile
> warning: unable to probe device toplology for device fsfile
> illegal sector size 0
> Usage: mkfs.xfs
> ...
>
> mkfs fails. :(
The fix looks good.
> Brown-paper-bag: Eric Sandeen <sandeen at sandeen.net>
> Signed-off-by: Eric Sandeen <sandeen at sandeen.net>
> ---
Reviewed-by: Alex Elder <aelder at sgi.com>
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 9a8eff3..faaafed 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -1574,7 +1574,7 @@ main(
> * Unless specified manually on the command line use the
> * advertised sector size of the device.
> */
> - sectorsize = ft.sectorsize;
> + sectorsize = ft.sectorsize ? ft.sectorsize : XFS_MIN_SECTORSIZE;
> }
>
> if (ft.sectoralign || !ssflag) {
>
> _______________________________________________
> xfs mailing list
> xfs at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
More information about the xfs
mailing list