linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] e4defrag: return more specific error message on ioctl failure
@ 2009-07-19 17:47 Peng Tao
  2009-07-19 18:00 ` Peng Tao
  2009-07-19 21:36 ` Eric Sandeen
  0 siblings, 2 replies; 4+ messages in thread
From: Peng Tao @ 2009-07-19 17:47 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso

Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
defragmentation. However, this iotcl kernel patch is not available before
2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
older kernels. The patch adds more detailed error message addressing this
issue and prompts users with the minimal kernel version that is needed to
run e4defrag.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 misc/e4defrag.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index c25514a..f1c3008 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -1553,7 +1553,11 @@ static int call_defrag(int fd, int donor_fd, const char *file,
 			if (mode_flag & DETAIL) {
 				printf("\n");
 				PRINT_ERR_MSG_WITH_ERRNO(
-						"Failed to defrag");
+					"Failed to defrag with "
+					"EXT4_IOC_MOVE_EXT ioctl");
+				if (errno == ENOTTY)
+					printf("\tAt least 2.6.31-rc1 of"
+						" vallina kernel is required\n");
 			} else {
 				printf("\t[ NG ]\n");
 			}
-- 
1.6.2.GIT


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

* Re: [PATCH 1/5] e4defrag: return more specific error message on ioctl failure
  2009-07-19 17:47 [PATCH 1/5] e4defrag: return more specific error message on ioctl failure Peng Tao
@ 2009-07-19 18:00 ` Peng Tao
  2009-07-19 21:36 ` Eric Sandeen
  1 sibling, 0 replies; 4+ messages in thread
From: Peng Tao @ 2009-07-19 18:00 UTC (permalink / raw)
  To: linux-ext4

oops, please ignore the [patch 1/5] series number. It was miss typed.

On Mon, Jul 20, 2009 at 1:47 AM, Peng Tao<bergwolf@gmail.com> wrote:
> Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
> defragmentation. However, this iotcl kernel patch is not available before
> 2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
> older kernels. The patch adds more detailed error message addressing this
> issue and prompts users with the minimal kernel version that is needed to
> run e4defrag.
>
> Signed-off-by: Peng Tao <bergwolf@gmail.com>
> ---
>  misc/e4defrag.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
> index c25514a..f1c3008 100644
> --- a/misc/e4defrag.c
> +++ b/misc/e4defrag.c
> @@ -1553,7 +1553,11 @@ static int call_defrag(int fd, int donor_fd, const char *file,
>                        if (mode_flag & DETAIL) {
>                                printf("\n");
>                                PRINT_ERR_MSG_WITH_ERRNO(
> -                                               "Failed to defrag");
> +                                       "Failed to defrag with "
> +                                       "EXT4_IOC_MOVE_EXT ioctl");
> +                               if (errno == ENOTTY)
> +                                       printf("\tAt least 2.6.31-rc1 of"
> +                                               " vallina kernel is required\n");
>                        } else {
>                                printf("\t[ NG ]\n");
>                        }
> --
> 1.6.2.GIT
>
>



-- 
Cheers,
Peng Tao
State Key Laboratory of Networking and Switching Technology
Beijing Univ. of Posts and Telecoms.

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

* Re: [PATCH 1/5] e4defrag: return more specific error message on ioctl failure
  2009-07-19 17:47 [PATCH 1/5] e4defrag: return more specific error message on ioctl failure Peng Tao
  2009-07-19 18:00 ` Peng Tao
@ 2009-07-19 21:36 ` Eric Sandeen
  2009-07-20  4:25   ` Peng Tao
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-07-19 21:36 UTC (permalink / raw)
  To: Peng Tao; +Cc: linux-ext4, tytso

Peng Tao wrote:
> Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
> defragmentation. However, this iotcl kernel patch is not available before
> 2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
> older kernels. The patch adds more detailed error message addressing this
> issue and prompts users with the minimal kernel version that is needed to
> run e4defrag.
> 
> Signed-off-by: Peng Tao <bergwolf@gmail.com>
> ---
>  misc/e4defrag.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
> index c25514a..f1c3008 100644
> --- a/misc/e4defrag.c
> +++ b/misc/e4defrag.c
> @@ -1553,7 +1553,11 @@ static int call_defrag(int fd, int donor_fd, const char *file,
>  			if (mode_flag & DETAIL) {
>  				printf("\n");
>  				PRINT_ERR_MSG_WITH_ERRNO(
> -						"Failed to defrag");
> +					"Failed to defrag with "
> +					"EXT4_IOC_MOVE_EXT ioctl");
> +				if (errno == ENOTTY)
> +					printf("\tAt least 2.6.31-rc1 of"
> +						" vallina kernel is required\n");

Typo here, s/b "vanilla"

-Eric

>  			} else {
>  				printf("\t[ NG ]\n");
>  			}


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

* Re: [PATCH 1/5] e4defrag: return more specific error message on ioctl failure
  2009-07-19 21:36 ` Eric Sandeen
@ 2009-07-20  4:25   ` Peng Tao
  0 siblings, 0 replies; 4+ messages in thread
From: Peng Tao @ 2009-07-20  4:25 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4, tytso

Eric Sandeen wrote:
> Peng Tao wrote:
>> Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
>> defragmentation. However, this iotcl kernel patch is not available before
>> 2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
>> older kernels. The patch adds more detailed error message addressing this
>> issue and prompts users with the minimal kernel version that is needed to
>> run e4defrag.
>>
>> Signed-off-by: Peng Tao <bergwolf@gmail.com>
>> ---
>>  misc/e4defrag.c |    6 +++++-
>>  1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
>> index c25514a..f1c3008 100644
>> --- a/misc/e4defrag.c
>> +++ b/misc/e4defrag.c
>> @@ -1553,7 +1553,11 @@ static int call_defrag(int fd, int donor_fd, const char *file,
>>  			if (mode_flag & DETAIL) {
>>  				printf("\n");
>>  				PRINT_ERR_MSG_WITH_ERRNO(
>> -						"Failed to defrag");
>> +					"Failed to defrag with "
>> +					"EXT4_IOC_MOVE_EXT ioctl");
>> +				if (errno == ENOTTY)
>> +					printf("\tAt least 2.6.31-rc1 of"
>> +						" vallina kernel is required\n");
> 
> Typo here, s/b "vanilla"
> 
> -Eric
Hi, Eric
Thank your for your reviewing. Revised the patch:

>From d56fcfae01c3b0c4963c0ec75ffa654e70086a57 Mon Sep 17 00:00:00 2001
From: Peng Tao <bergwolf@gmail.com>
Date: Mon, 20 Jul 2009 12:11:01 +0800
Subject: [PATCH] e4defrag: return more specific error message on ioctl failure

Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
defragmentation. However, this iotcl kernel patch is not available before
2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
older kernels. The patch adds more detailed error message addressing this
issue and prompts users with the minimal kernel version that is needed to
run e4defrag.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 misc/e4defrag.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index c25514a..eff6ed9 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -1553,7 +1553,11 @@ static int call_defrag(int fd, int donor_fd, const char *file,
 			if (mode_flag & DETAIL) {
 				printf("\n");
 				PRINT_ERR_MSG_WITH_ERRNO(
-						"Failed to defrag");
+					"Failed to defrag with "
+					"EXT4_IOC_MOVE_EXT ioctl");
+				if (errno == ENOTTY)
+					printf("\tAt least 2.6.31-rc1 of "
+						"vanilla kernel is required\n");
 			} else {
 				printf("\t[ NG ]\n");
 			}

-- 
Best Regards,
Peng Tao
State Key Laboratory of Networking and Switching Technology
Beijing Univ. of Posts and Telecoms.

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

end of thread, other threads:[~2009-07-20  4:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 17:47 [PATCH 1/5] e4defrag: return more specific error message on ioctl failure Peng Tao
2009-07-19 18:00 ` Peng Tao
2009-07-19 21:36 ` Eric Sandeen
2009-07-20  4:25   ` Peng Tao

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