[Ocfs2-tools-devel] [PATCH] mkfs.ocfs2: Handle block devices with missing ioctl(BLKSSZGET)

Joel Becker Joel.Becker at oracle.com
Tue Jul 28 14:23:47 PDT 2009


On Tue, Jul 28, 2009 at 02:20:06PM -0700, Sunil Mushran wrote:
> Make mkfs.ocfs2 use the default minimum blocksize if the block device is missing
> support for ioctl(BLKSSZGET).
> 
> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>

sobby

> ---
>  mkfs.ocfs2/mkfs.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
> index 2eac8a4..8e910fa 100644
> --- a/mkfs.ocfs2/mkfs.c
> +++ b/mkfs.ocfs2/mkfs.c
> @@ -1205,10 +1205,14 @@ fill_defaults(State *s)
>  
>  	err = ocfs2_get_device_sectsize(s->device_name, &sectsize);
>  	if (err) {
> -		com_err(s->progname, err,
> -			"while getting hardware sector size of device %s",
> -			s->device_name);
> -		exit(1);
> +		if (err == OCFS2_ET_CANNOT_DETERMINE_SECTOR_SIZE)
> +			sectsize = 0;
> +		else {
> +			com_err(s->progname, err,
> +				"while getting hardware sector size of "
> +				"device %s", s->device_name);
> +			exit(1);
> +		}
>  	}
>  	if (!sectsize)
>  		sectsize = OCFS2_MIN_BLOCKSIZE;
> -- 
> 1.6.0.4
> 
> 
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel

-- 

"But all my words come back to me
 In shades of mediocrity.
 Like emptiness in harmony
 I need someone to comfort me."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list