lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1110170855010.3115@dhcp-27-109.brq.redhat.com>
Date:	Mon, 17 Oct 2011 08:56:27 +0200 (CEST)
From:	Lukas Czerner <lczerner@...hat.com>
To:	Yongqiang Yang <xiaoqiangnk@...il.com>
cc:	Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org,
	tytso@....edu
Subject: Re: [PATCH] resize: Do not fail if EXT4_IOC_RESIZE_FS ioctl doesn't
 exist

On Mon, 17 Oct 2011, Yongqiang Yang wrote:

> On Fri, Oct 14, 2011 at 11:49 PM, Lukas Czerner <lczerner@...hat.com> wrote:
> > 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.
> >
> > Signed-off-by: Lukas Czerner <lczerner@...hat.com>
> > ---
> >
> > 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(-)
> >
> > diff --git a/resize/online.c b/resize/online.c
> > index 77290c2..1a77839 100644
> > --- a/resize/online.c
> > +++ b/resize/online.c
> > @@ -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 !
> > +               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

> 
> 
> Yongqiang.
> >                        if (errno == EPERM)
> >                                com_err(program_name, 0,
> >                                _("Permission denied to resize filesystem"));
> > --
> > 1.7.4.4
> >
> >
> 
> 
> 
> 

-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ