xfs
[Top] [All Lists]

RE: [PATCH] mkfs: fix mkfs when blkid fails

To: "Eric Sandeen" <sandeen@xxxxxxxxxxx>
Subject: RE: [PATCH] mkfs: fix mkfs when blkid fails
From: "Alex Elder" <aelder@xxxxxxx>
Date: Thu, 14 Jan 2010 15:06:15 -0600
Cc: "xfs mailing list" <xfs@xxxxxxxxxxx>
In-reply-to: <4B4F7C0F.9010004@xxxxxxxxxxx>
Thread-index: AcqVWXi1zAtUBe6ERced8B5sSOnxMQAA2HUQ
Thread-topic: [PATCH] mkfs: fix mkfs when blkid fails
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@xxxxxxxxxxx>
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
> ---

Reviewed-by: Alex Elder <aelder@xxxxxxx>


> 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@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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