linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [f2fs-tools] mkfs: Make HDIO_GETGEO ioctl optional
@ 2012-12-12  2:08 Ezequiel Garcia
  2012-12-12  2:19 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Ezequiel Garcia @ 2012-12-12  2:08 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: jaegeuk.kim, Ezequiel Garcia, Ezequiel Garcia

From: Ezequiel Garcia <ezequiel@free-electrons.com>

Some block devices don't implement HDIO_GETGEP ioctl;
loop device being a notable example.
Without this patch, it's not possible to make a f2fs
on a file mounted over a loop device.

Signed-off-by: Ezequiel Garcia <ezequiel@free-electrons.com>
---
 mkfs/f2fs_format.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index d3e1d0c..b542db5 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -262,11 +262,10 @@ static int8_t f2fs_get_device_info()
 			return -1;
 		}
 
-		if (ioctl(fd, HDIO_GETGEO, &geom) < 0) {
-			printf("\n\tError: Cannot get the device geometry\n");
-			return -1;
-		}
-		f2fs_params.start_sector = geom.start;
+		if (ioctl(fd, HDIO_GETGEO, &geom) < 0)
+			f2fs_params.start_sector = 0;
+		else
+			f2fs_params.start_sector = geom.start;
 	}
 	else {
 		printf("\n\n\tError: Volume type is not supported!!!\n");
-- 
1.7.8.6


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

* Re: [PATCH] [f2fs-tools] mkfs: Make HDIO_GETGEO ioctl optional
  2012-12-12  2:08 [PATCH] [f2fs-tools] mkfs: Make HDIO_GETGEO ioctl optional Ezequiel Garcia
@ 2012-12-12  2:19 ` Jaegeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2012-12-12  2:19 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: linux-fsdevel, Ezequiel Garcia

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

2012-12-11 (화), 23:08 -0300, Ezequiel Garcia:
> From: Ezequiel Garcia <ezequiel@free-electrons.com>
> 
> Some block devices don't implement HDIO_GETGEP ioctl;
> loop device being a notable example.
> Without this patch, it's not possible to make a f2fs
> on a file mounted over a loop device.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@free-electrons.com>
> ---
>  mkfs/f2fs_format.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index d3e1d0c..b542db5 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -262,11 +262,10 @@ static int8_t f2fs_get_device_info()
>  			return -1;
>  		}
>  
> -		if (ioctl(fd, HDIO_GETGEO, &geom) < 0) {
> -			printf("\n\tError: Cannot get the device geometry\n");
> -			return -1;
> -		}
> -		f2fs_params.start_sector = geom.start;
> +		if (ioctl(fd, HDIO_GETGEO, &geom) < 0)
> +			f2fs_params.start_sector = 0;
> +		else
> +			f2fs_params.start_sector = geom.start;
>  	}
>  	else {
>  		printf("\n\n\tError: Volume type is not supported!!!\n");

Merged, thanks. :)

-- 
Jaegeuk Kim
Samsung

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-12-12  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12  2:08 [PATCH] [f2fs-tools] mkfs: Make HDIO_GETGEO ioctl optional Ezequiel Garcia
2012-12-12  2:19 ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).