resize: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't exist
PATCH 1/1 resize: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't exist
Commit 9f6ba888f027ba4daf57ac61a11a6dce98e42347 added support for new online resize ioctl EXT4_IOC_RESIZE_FS. It is also trying to avoid failure when this ioctl() is not supported by the kernel however it is checking wrong error code (EINVAL).
When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ? The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
resize/online.c +6 -1
@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, }if (ioctl (fd,EXT4_IOC_RESIZE_FS , new_size)) { -if (errno !=EINVAL ) { +/* +* If kernel does not support EXT4_IOC_RESIZE_FS, use the +* old online resize. Note that the old approach does not +* handle >32 bit file systems +*/ +if (errno !=ENOTTY ) {if (errno ==EPERM )com_err (program_name,0 ,_ ("Permission denied to resize filesystem" ));
Signature · 1 line
1.7.4.4
Quoted 11 lines · Lukas Czerner
Commit
9f6ba888f027ba4daf57ac61a11a6dce98e42347added support for new online resize ioctlEXT4_IOC_RESIZE_FS. It is also trying to avoid failure when thisioctl()is not supported by the kernel however it is checking wrong error code (EINVAL).When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
Signed-off-by Lukas Czerner <[email protected]>
Makes sense, thanks.
Quoted 29 lines
---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ? The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)resize/online.c +6
-1@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, }if (ioctl (fd,EXT4_IOC_RESIZE_FS , new_size)) { -if (errno !=EINVAL ) { +/* +* If kernel does not support EXT4_IOC_RESIZE_FS, use the +* old online resize. Note that the old approach does not +* handle >32 bit file systems +*/ +if (errno !=ENOTTY ) {if (errno ==EPERM )com_err (program_name,0 ,_ ("Permission denied to resize filesystem" ));
Quoted 10 lines · Lukas Czerner
Commit
9f6ba888f027ba4daf57ac61a11a6dce98e42347added support for new online resize ioctlEXT4_IOC_RESIZE_FS. It is also trying to avoid failure when thisioctl()is not supported by the kernel however it is checking wrong error code (EINVAL).When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
Quoted 5 lines
Signed-off-by Lukas Czerner <[email protected]>---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ?
AFAIK, the latest version of the patches is here:
https://github.com/YANGYongqiang/ext4-patch-queue
and I suppose Ted should have it in patchworks as well.
Ted,
Are you planning to merge new online resize for 3.2?
Thanks,
Amir.
Quoted 28 lines
The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)resize/online.c +6
-2@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, } if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { - if (errno != EINVAL) { + /* + * If kernel does not support EXT4_IOC_RESIZE_FS, use the + * old online resize. Note that the old approach does not + * handle >32 bit file systems + */ + if (errno != ENOTTY) { if (errno == EPERM) com_err(program_name, 0, _("Permission denied to resize filesystem")); --1.7.4.4
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Amir Goldstein
Quoted 10 lines · Lukas Czerner
Commit
9f6ba888f027ba4daf57ac61a11a6dce98e42347added support for new online resize ioctlEXT4_IOC_RESIZE_FS. It is also trying to avoid failure when thisioctl()is not supported by the kernel however it is checking wrong error code (EINVAL).When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
Quoted 5 lines
Signed-off-by Lukas Czerner <[email protected]>---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ?
Quoted 8 lines
AFAIK, the latest version of the patches is here:
https://github.com/YANGYongqiang/ext4-patch-queueand I suppose Ted should have it in patchworks as well.
Ted,
Are you planning to merge new online resize for 3.2?
Thanks Amir,
also it would be nice if the kernel functionality was merged before the corresponding user-space tools as I thought it is the right course of action.
Also Ted, could you merge this patch ASAP, since the online resize2fs is unusable in the current state.
Thanks!
-Lukas
Quoted 40 lines
Thanks,
Amir.Quoted 33 lines
The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)resize/online.c +6
-2@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, } if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { - if (errno != EINVAL) { + /* + * If kernel does not support EXT4_IOC_RESIZE_FS, use the + * old online resize. Note that the old approach does not + * handle >32 bit file systems + */ + if (errno != ENOTTY) { if (errno == EPERM) com_err(program_name, 0, _("Permission denied to resize filesystem")); --1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 27 lines · Lukas Czerner
Commit
9f6ba888f027ba4daf57ac61a11a6dce98e42347added support for new online resize ioctlEXT4_IOC_RESIZE_FS. It is also trying to avoid failure when thisioctl()is not supported by the kernel however it is checking wrong error code (EINVAL).When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
Signed-off-by Lukas Czerner <[email protected]>---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ? The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)resize/online.c +0
-0
resize/online.c errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, · line 79
Quoted 9 lines
resize/online.c +5
-1@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, } if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { - if (errno != EINVAL) { + /* +* If kernel does not support EXT4_IOC_RESIZE_FS, use the +* old online resize. Note that the old approach does not +* handle >32 bit file systems +*/
Great comment !
resize/online.c errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, · line 80
Quoted 1 line
resize/online.c +1
-0+ if (errno != ENOTTY) {
In my working tree, it has been ENOTTY but there is no comment. And I
found EINVAL was introduced in commit 200569608fc6e33f6546(https://github.com/tytso/e2fsprogs/commit/200569608fc6e33f6546c17999f14fb5dbb0b9b5) to fix some bugs and reason is listed.
Yongqiang.
Quoted 7 lines
resize/online.c +0
-1if (errno == EPERM) com_err(program_name, 0, _("Permission denied to resize filesystem")); --1.7.4.4
Signature · 6 lines
Best Wishes Yongqiang Yang -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 38 lines · Yongqiang Yang
Quoted 27 lines · Lukas Czerner
Commit
9f6ba888f027ba4daf57ac61a11a6dce98e42347added support for new online resize ioctlEXT4_IOC_RESIZE_FS. It is also trying to avoid failure when thisioctl()is not supported by the kernel however it is checking wrong error code (EINVAL).When the ioctl does not exist, errno is set to ENOTTY, so we should check for that, rather than EINVAL which means that ioctl arguments are not valid. So change the code to check for ENOTTY and allow resize2fs to try to use the old approach. Also add some comments.
Signed-off-by Lukas Czerner <[email protected]>---
Btw I can not find the new kernel code anywhere. It is not in Linus tree, it also is not in the github ext4 master, nor dev tree. Where it is then ? The problem is that the recent released e2fsprogs are broken for all kernels. To be more specific, resize2fs is broken for all kernels.
resize/online.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)resize/online.c +0
-0resize/online.c errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, · line 79
Quoted 9 lines
resize/online.c +5
-1@@ -72,7 +72,12 @@ errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, } if (ioctl(fd, EXT4_IOC_RESIZE_FS, new_size)) { - if (errno != EINVAL) { + /* +* If kernel does not support EXT4_IOC_RESIZE_FS, use the +* old online resize. Note that the old approach does not +* handle >32 bit file systems +*/ Great comment !
Quoted 5 lines
resize/online.c errcode_t online_resize_fs(ext2_filsys fs, const char *mtpt, · line 80
Quoted 1 line
resize/online.c +1
-0+ if (errno != ENOTTY) {In my working tree, it has been ENOTTY but there is no comment. And I
found EINVAL was introduced in commit 200569608fc6e33f6546(https://github.com/tytso/e2fsprogs/commit/200569608fc6e33f6546c17999f14fb5dbb0b9b5) to fix some bugs and reason is listed.
Oh, I am sorry. I have missed the line in git blame. You're right it was originally ENOTTY, thanks!
-Lukas
Quoted 14 lines
Yongqiang.
Quoted 7 lines
resize/online.c +0
-1if (errno == EPERM) com_err(program_name, 0, _("Permission denied to resize filesystem")); --1.7.4.4