public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkfs: fix mkfs when blkid fails
@ 2010-01-14 20:18 Eric Sandeen
  2010-01-14 21:06 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2010-01-14 20:18 UTC (permalink / raw)
  To: xfs mailing list

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@sandeen.net>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] mkfs: fix mkfs when blkid fails
  2010-01-14 20:18 [PATCH] mkfs: fix mkfs when blkid fails Eric Sandeen
@ 2010-01-14 21:06 ` Alex Elder
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2010-01-14 21:06 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs mailing list

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@sandeen.net>
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---

Reviewed-by: Alex Elder <aelder@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@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-14 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 20:18 [PATCH] mkfs: fix mkfs when blkid fails Eric Sandeen
2010-01-14 21:06 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox