xfs
[Top] [All Lists]

[PATCH] mkfs: fix mkfs when blkid fails

To: xfs mailing list <xfs@xxxxxxxxxxx>
Subject: [PATCH] mkfs: fix mkfs when blkid fails
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 14 Jan 2010 14:18:23 -0600
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
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.  :(

Brown-paper-bag: Eric Sandeen <sandeen@xxxxxxxxxxx>
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
---


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) {

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